Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors with WMR #193

Open
zgoda opened this issue Apr 28, 2021 · 2 comments
Open

Errors with WMR #193

zgoda opened this issue Apr 28, 2021 · 2 comments

Comments

@zgoda
Copy link

zgoda commented Apr 28, 2021

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).

@zgoda
Copy link
Author

zgoda commented Oct 16, 2021

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)

@rschristian
Copy link

rschristian commented Nov 10, 2021

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants