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

Webpack error: require function is used in a way in which dependencies cannot be statically extracted #19

Closed
adamjmcgrath opened this issue May 1, 2020 · 7 comments

Comments

@adamjmcgrath
Copy link
Contributor

Hi, we're hitting an issue when webpack builds the output in CI mode auth0/auth0-spa-js#447

When we tested it originally we noticed a warning: require function is used in a way in which dependencies cannot be statically extracted but thought we could ignore it.

But with the CI environment enabled, this turns into an error.

It seems webpack doesn't like the var kRequire = require; kRequire('something'); happening in https://github.com/darionco/rollup-plugin-web-worker-loader/blob/master/src/helper/node/WorkerClass.js#L4

@darionco
Copy link
Owner

darionco commented May 1, 2020

Webpack is a pain to work with lol, they provide a way to not process certain require statements but they throw a warning when you use it... that warning becomes an error in CI because they upgrade warnings to errors.

Let me see what can be donee here.

@darionco
Copy link
Owner

darionco commented May 1, 2020

Fixed in 1.1.2

@adamjmcgrath
Copy link
Contributor Author

adamjmcgrath commented May 1, 2020

Thanks for resolving that so quickly, although I think you may have published a local branch
I'm seeing a file called plugin/options.js for example in the installed package

@adamjmcgrath
Copy link
Contributor Author

Also, we're seeing a different warning Can't resolve 'worker_threads' in '/dist'
(although - it's not failing with CI=true which is good)

@darionco
Copy link
Owner

darionco commented May 1, 2020

ohh ffs, you are right, I am refactoring other parts of the code and that file lingered there for some reason.... I'll just release the refactored version soon.

The new warning is not showing up on my test project, could you elaborate on the repro steps?

@adamjmcgrath
Copy link
Contributor Author

I'll just release the refactored version soon.

Cool, np

The new warning is not showing up on my test project, could you elaborate on the repro steps?

I'll setup a minimal case and share it with you some time over the weekend

Thanks!

@adamjmcgrath
Copy link
Contributor Author

I'll setup a minimal case and share it with you some time over the weekend

Have raised #20

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