-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
indirect access of 'require' #80
Comments
This is a similar issue to #56, and is intentional. Bundling with esbuild is intended to traverse your whole dependency tree and include all of your dependencies in the bundle. However, it can only do this if the dependency tree is statically analyzable. This is why esbuild needs every use of |
One possibility could be to change this into a warning (either by default or as an option). That would allow the build to continue and generate the bundle. The call to |
Hmm I'm not it's the same case here is it? The code in this file never actually calls require with any arguments that aren't statically analyzable, I think making it a warning would fix the issue. https://raw.githubusercontent.com/SheetJS/sheetjs/master/jszip.js Though I agree that this is very strange |
The warning could hide the actual error. Did you try bundling the module delivered by
And in your code:
This is how I included |
This should be fixed in version 0.5.3. It turns out the problem was specifically caused by code bundled with Browserify, so I have special-cased this code pattern in esbuild. You can read more in the release notes. |
@prantlf how did you fix this?
|
when trying to use https://github.com/SheetJS/sheetjs
you run into the following error.
Is it intentional? Currently getting around this issue by hosting a copy of the dependency without the
typeof require == 'function'
calls, but it would be nice if the library allowed those checksLet me know if there's anything I can do to help! I can possibly dig in and make the exception for this case somewhere here
esbuild/src/esbuild/parser/parser.go
Line 7573 in db7fd2b
The text was updated successfully, but these errors were encountered: