-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Npm package 'qrcode' causes Uncaught RangeError: Maximum call stack size exceeded #1086
Comments
what browser did you test? IE? or doe's it crash in chrome also? if the problem is with IE only, it reminds me of a problem I had a while back that was caused because of bluebird. try setting this in your code: import * as Bluebird from 'bluebird';
/**
* Disable long stack traces for IE11
*/
Bluebird.config(
{
warnings: {
wForgottenReturn: false
},
longStackTraces: false
}
); |
I can reproduce this problem with requirejs and systemjs. It seems has something to do with the Buffer object. I haven't figured out what exactly happened. It looks like the other bundler I am working on, is immune to this issue. If you want, you can try to use one of the Aurelia examples here: https://github.com/dumberjs/examples Note, with dumber, you don't need to bring in Also, dumber is stable enough, I am running all my production apps with dumber. |
Update: please ignore my suggestion on dumber. You can make it work with current Aurelia-CLI, I just found out qrcode shipped with a precompiled umd build. Use explicit dep config in aurelia.json "dependencies": [
// ...
{
"name": "qrcode",
"path": "../node_modules/qrcode/build/qrcode.min.js"
}
] |
Now I understand why it broke. qrcode has an inner implementation of Aurelia-CLI doesn't have proper solution for localized import Buffer from 'buffer';
window.Buffer = Buffer; But this workaround creates global var dumber is not affected, because dumber does proper local stub for The qrcode bundle file is self-sealed with no additional dependency(no more |
@CollinHerber what was your setup with v0.33 with this qrcode app? Do you have aurelia.json to share? |
@huochunpeng This was my aurelia.json entry for 0.33
Let me know if there is anything else I can provide. |
@CollinHerber thx, that's the umd build, same as my suggested fix for working within the new cli bundler. That cleared my doubt how the old cli bundler worked. Basically you need to retain that explicit config for qrcode. That's unfortunate due to the limitation of current cli bundler. |
Can be closed as won't fix with workaround provided |
I'm submitting a bug report
1.0.0-beta.15
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
v8.11.3
NPM Version:
6.7.0
Browser:
all
Language:
ESNext
Loader/bundler:
RequireJS
Current behavior:
Importing 'qrcode' npm package causes an "Exceeded Callstack" error. Prevent page load.
VM1366 vendor-bundle.js:55 Uncaught RangeError: Maximum call stack size exceeded
Repro Steps
au new
ESNext/RequireJS/SASS/Babel/Max Minificationnpm i qrcode
import * as qrcode from 'qrcode'
orimport qrcode from 'qrcode'
orimport 'qrcode'
Importing 'qrcode' npm package not to break.
PS
I wish I knew what was causing this, perhaps I'm doing something wrong on my end? I did an update from 0.33 to 1.0b15 as I've done with several of my projects and this one just happened to have that npm package in there causing that issue.
Full picture cause yth not http://prntscr.com/n9b0j6
The text was updated successfully, but these errors were encountered: