Skip to content

Errors with WMR #193

Open
Open

Description

@zgoda

Build:

$ npm run build

> build
> wmr build --prerender

Error when using sourcemap for reporting an error: Can't resolve original location of error.

'Provider' is not exported by npm/unistore@3.5.2/preact.js, imported by public/index.js
    at si (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:88033)
    at Ia.error (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:171300)
    at Ia.traceVariable (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:179030)
    at Ho.findVariable (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:157247)
    at En.findVariable (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:43076)
    at Bn.findVariable (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:43076)
    at Kn.bind (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:63816)
    at Go.bind (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:44364)
    at Fo.bind (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:44378)
    at Fo.bind (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:155881)

In dev (excerpt):

Error bundling unistore/preact.js.map:  Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at si (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:88033)
    at Ia.error (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:171300)
    at Ia.tryParse (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:179404)
    at Ia.setSource (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:176750)
    at uu.addModuleSource (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:328734)
    at async uu.fetchModule (/home/jazg/work/micro/beercounter/node_modules/wmr/wmr.cjs:2:329907)
    at async Promise.all (index 0) {
  code: 'PARSE_ERROR',
  parserError: SyntaxError: Unexpected token (1:10)

It seems incompatible with WMR (or vice-versa).

Activity

  1. zgoda commented on Oct 16, 2021

    @zgoda
    Author

    With recent WMR in dev:

    Error bundling unistore/@npm/preact:  Error: Could not load npm/unistore@3.5.2/@npm/preact: File not found ENOENT: no such file or directory, open '/home/jazg/work/breadcalc2/node_modules/unistore/@npm/preact'
        at WR (/home/jazg/work/breadcalc2/node_modules/wmr/wmr.cjs:2:1240242)
        at async Ku.addModuleSource (/home/jazg/work/breadcalc2/node_modules/wmr/wmr.cjs:2:352834)
        at async Ku.fetchModule (/home/jazg/work/breadcalc2/node_modules/wmr/wmr.cjs:2:354542)
        at async Promise.all (index 0) {
      code: 'PLUGIN_ERROR',
      plugin: 'npm-plugin',
      hook: 'load',
      watchFiles: [ 'npm/unistore@3.5.2/@npm/preact' ]
    }
    
    500 /@npm/unistore/@npm/preact - Could not load npm/unistore@3.5.2/@npm/preact: File not found ENOENT: no such file or directory, open '/home/jazg/work/breadcalc2/node_modules/unistore/@npm/preact'
    
      at WR (/home/jazg/work/breadcalc2/node_modules/wmr/wmr.cjs:2:1240242)
      at async Ku.addModuleSource (/home/jazg/work/breadcalc2/node_modules/wmr/wmr.cjs:2:352834)
      at async Ku.fetchModule (/home/jazg/work/breadcalc2/node_modules/wmr/wmr.cjs:2:354542)
      at async Promise.all (:-1:-1)
    
  2. rschristian commented on Nov 10, 2021

    @rschristian

    You should be able to import from unistore/full/preact.es.js without issue.

    The top level preact.js is CJS, which is probably going to struggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions