Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Error in codec-pool-worker.js #297

Closed
jonatanmartinbabel opened this issue Jan 17, 2022 · 7 comments
Closed

Error in codec-pool-worker.js #297

jonatanmartinbabel opened this issue Jan 17, 2022 · 7 comments

Comments

@jonatanmartinbabel
Copy link

ERROR in ./node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool-worker.js
Module parse failed: Unexpected token (110:57)
You may need an appropriate loader to handle this file type.
|
| function getWorker(options = {}) {
| return new Worker(new URL(workerData.scripts[0], import.meta.url), options);
| }
|

webpack: Failed to compile.

@gildas-lormeau
Copy link
Owner

Are you using the version 4 of webpack?

@jonatanmartinbabel
Copy link
Author

I am using version 3.11.0 of webpack (Angular 5)

@jonatanmartinbabel
Copy link
Author

I am using version 3.11.0 of webpack (Angular 5)

Should I use another version of zip.js ?
Is there a versions table in the docs?

@gildas-lormeau
Copy link
Owner

You probably need to include a loader to add the support of import.meta.url in webpack. Here is the procedure how to do so with webpack 4: #229. I hope it will work with webpack 3 as well.

@jonatanmartinbabel
Copy link
Author

jonatanmartinbabel commented Jan 17, 2022

You probably need to include a loader to add the support of import.meta.url in webpack. Here is the procedure how to do so with webpack 4: #229. I hope it will work with webpack 3 as well.

Seems like a good solution for some projects, but it didn't work on mine.

btw, I found this info from the webpack-import-meta-loader plugin author

https://www.npmjs.com/package/@open-wc/webpack-import-meta-loader

image

@gildas-lormeau
Copy link
Owner

I was not able to include babel in the build script, cf. #296 (comment).

@gildas-lormeau
Copy link
Owner

I'm moving this issue in the Discussions because it's not a bug in zip.js which uses rollup to build files while the question is related to webpack 3.

Repository owner locked and limited conversation to collaborators Jan 20, 2022
@gildas-lormeau gildas-lormeau converted this issue into discussion #298 Jan 20, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants