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
function is being called before being assigned (undefined variable) #4231
Comments
Very likely a known issue of the commonjs plugin because it cannot handle circular dependencies in CommonJS code correctly. I have actually started working on a fix, but it will be a long shot until anything will come out of this, weeks at least. |
Ok thanks for the heads up. I'll try and see how I can reorganize things then |
ok I see that my error is well documented: among others, closing. |
fixed with this approach: nodejs/readable-stream#348 (comment) |
We are finalizing a new version of the commonjs plugin in rollup/plugins#1038. It is pre-published as |
Rollup Version
2.57.0
Operating System (or Browser)
Mac Os
Node Version (if applicable)
15
Link To Reproduction
https://github.com/blockchain-certificates/cert-verifier-js/tree/feat/did-support-backup-with-buffer-fallback
Expected Behaviour
When I build and then execute, the functions are not called before being defined.
Actual Behaviour
I have had this bug/issue opened on stackoverflow for about 2 weeks now and I am not making any progress on it, nor getting support. I am starting to wonder if it could be a bug?
https://stackoverflow.com/questions/69165942/rollupjs-function-is-being-called-before-definition-bundled-code
Basically a call is made to a variable that's assigned after it's being called. When I manually change the position of the instantiation, it then does not fail on that issue (but on another one I haven't explored yet).
To repro, use the branch I am pointing to, then
npm run build:iife
and thennpm run test:manual:browser
. The output of v3 shows the js error on which it fails.The text was updated successfully, but these errors were encountered: