Skip to content
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

Problem with rollup: 'syntheticNamedExports: "__moduleExports"' needs an explicit export named "__moduleExports" that does not reexport an unresolved named export of the same module. #166

Open
TimSC opened this issue Jul 6, 2022 · 1 comment

Comments

@TimSC
Copy link

TimSC commented Jul 6, 2022

I am having trouble with react-tiny-popover 7.1 using rollup 2.75.7. Searching for the error message reveals it has something to do with the fix for "Improve circular dependency execution order" in rollup/rollup#3840

rollup v2.75.7
bundles index.tsx, internal/InternalComponent.tsx, company/xyz/XyzComponent.tsx → ../flask_cc...
(!) Circular dependencies
qgis2web/layers.ts -> qgis2web/layerBases.ts -> qgis2web/layers.ts
App.tsx -> components/LayerControl.tsx -> App.tsx
qgis2web/tableControl.ts -> qgis2web/open_table.ts -> qgis2web/tableControl.ts
qgis2web/selectFeaturesControl.ts -> qgis2web/sumFeaturesControl.ts -> qgis2web/selectFeaturesControl.ts
qgis2web/tableControl.ts -> qgis2web/selectFeaturesControl.ts -> qgis2web/tableControl.ts
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
https://cdn.jsdelivr.net/npm/wkx@0.4.6/dist/wkx.js (imported by components/KmlControl.tsx)
https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js (imported by components/KmlControl.tsx)
https://epsg.io/102008.js (imported by components/KmlControl.tsx)
(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
[!] Error: Module "node_modules/react-tiny-popover/dist/useElementRef.js" that is marked with 'syntheticNamedExports: "__moduleExports"' needs an explicit export named "__moduleExports" that does not reexport an unresolved named export of the same module.
node_modules/react-tiny-popover/dist/useElementRef.js
Error: Module "node_modules/react-tiny-popover/dist/useElementRef.js" that is marked with 'syntheticNamedExports: "__moduleExports"' needs an explicit export named "__moduleExports" that does not reexport an unresolved named export of the same module.
    at error (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:198:30)
    at Module.getSyntheticNamespace (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12690:20)
    at /home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12745:125
    at getOrCreate (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:2152:19)
    at Module.getVariableForExportName (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12745:17)
    at getVariableForExportNameRecursive (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12403:19)
    at Module.getVariableForExportName (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12708:32)
    at getVariableForExportNameRecursive (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12403:19)
    at Module.traceVariable (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:12912:35)
    at ModuleScope.findVariable (/home/tim/dev/front-end/react_app/node_modules/rollup/dist/shared/rollup.js:11566:39)
@TimSC
Copy link
Author

TimSC commented Jul 6, 2022

Using the "export default" style at the end of each file seems to make it work. I'll have a look at synthetic named exports options in rollup next.

//exports.ArrowContainer = ArrowContainer; //commented out
export default ArrowContainer;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant