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
failing to shim with browserify 6.3 #81
Comments
Have you tried your configuration outside of browserify-rails with browserify 6 and browserify-shim to confirm it's something within browserify-rails that is causing the issue? There has been some odd breakages beyond browserify 4 that I've seen and are hard to track down. browserify-rails is not doing a whole lot of processing of the JS -- it is basically taking the sprocketized-javascript that is emitted from a pipe and sending that pipe to browserify to resolve the CommonJS requires and exports. So not a lot of processing -- but you may find if you try piping the input JavaScript to browserify instead of reading it from a file, you reproduce the bug outside of browserify-rails. |
@cymen just a moment, i'll try this now. |
Yes it does. test.coffeerequire 'bootstrap.transition' test command
I firstly changed package.json to 4.0, npm install then ran the above command. Changed it to 6.3, npm install and the command again. There were differences in the files, however they both included jQuery as a dependency. |
You need to literally pipe the input into browserify though -- by using |
I can come up with an example at some point but not right at this very moment. There should be some examples out there -- likely |
Okay fascinating, you're right @cymen!
By using this command, jquery is loaded with 4.0 but not with 6.3. Do you know if this is logged as an issue on browserify? |
@marcgreenstock I do not know -- I did open this issue: browserify/browserify#1019 but I think what you are running into is different. This might be related: browserify/browserify#868 |
It seems that browserify-rails doesn't play nicely with browserify 6.3 if browserify-shim is involved.
The shimmed modules do not load their respective dependencies with 6.3, however they load perfectly fine with 4.0.
I am observing this in an Isolated Engine, not sure if this will make any difference.
package.json
Engine.rb
The result is bootstrap complaining that jQuery is not available. However when changing the browserify dependency in package.json to 4.0, there is no problem.
The text was updated successfully, but these errors were encountered: