You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When re-exporting an external module twice while having it in the external pattern of the rollup config, rollup seems to not find any export of that module. It can be resolved by either removing one of the re-exports or removing the dependency from the list of external modules. In case of the example linked above, everything starts working again as soon as I import from b.js instead of a.js and results in the bundle below.
> rollup -c
./src/index.js → esm...
[!] Error: 'useState' is not exported by src\a.js, imported by src\index.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src\index.js (1:8)
1: import {useState} from './a';
^
2:
3: console.log(useState);
Error: 'useState' is not exported by src\a.js, imported by src\index.js
at error (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:164:30)
at Module.error (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:9888:16)
at Module.traceVariable (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:10269:29)
at ModuleScope.findVariable (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:9046:39)
at Identifier.bind (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:4572:40)
at CallExpression.bind (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:2891:31)
at CallExpression.bind (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:6995:15)
at ExpressionStatement.bind (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:2895:23)
at Program.bind (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:2891:31)
at Module.bindReferences (C:\develop\sandbox_rollup\node_modules\rollup\dist\shared\rollup.js:9884:18)
The text was updated successfully, but these errors were encountered:
Rollup Version
2.52.3
Operating System (or Browser)
Windows
Node Version (if applicable)
14.15.1
Link To Reproduction
https://rollupjs.org/repl/?version=2.52.3&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyM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IwcGx1Z2lucyUzQSUyMCU1QiU1Q24lMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBub2RlUmVzb2x2ZSgpJTJDJTVDbiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGNvbW1vbmpzKCklMkMlNUNuJTIwJTIwJTIwJTIwJTVEJTVDbiU3RCUyMiU3RCU1RCUyQyUyMm9wdGlvbnMlMjIlM0ElN0IlMjJmb3JtYXQlMjIlM0ElMjJlcyUyMiUyQyUyMm5hbWUlMjIlM0ElMjJteUJ1bmRsZSUyMiUyQyUyMmFtZCUyMiUzQSU3QiUyMmlkJTIyJTNBJTIyJTIyJTdEJTJDJTIyZ2xvYmFscyUyMiUzQSU3QiU3RCU3RCUyQyUyMmV4YW1wbGUlMjIlM0FudWxsJTdE
Expected Behaviour
When re-exporting an external module twice while having it in the external pattern of the rollup config, rollup seems to not find any export of that module. It can be resolved by either removing one of the re-exports or removing the dependency from the list of external modules. In case of the example linked above, everything starts working again as soon as I import from
b.js
instead ofa.js
and results in the bundle below.Actual Behaviour
The text was updated successfully, but these errors were encountered: