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

syntax error: The requested module '@rollup/plugin-terser' does not provide an export named 'terser' #1397

Closed
cwebba1 opened this issue Jan 8, 2023 · 8 comments

Comments

@cwebba1
Copy link

cwebba1 commented Jan 8, 2023

  • Rollup Plugin Name: rollup/plugin-terser
  • Rollup Plugin Version: 0.3.0
  • Rollup Version: "rollup": "^3.3.0"
  • Operating System (or Browser): Mac/Chrome
  • Node Version: v19.0.1
  • Link to reproduction (⚠️ read below):

https://stackblitz.com/github/cwebba1/shortstack-openprops-cwebba

Expected Behavior

Adding
"@rollup/plugin-terser": "^0.3.0",
to package.json
Adding
import { terser } from '@rollup/plugin-terser'
to rollup.config.mjs

Actual Behavior

I am getting a syntax error I do not know how to resolve. the script does not find export for Terser.

Additional Information

[dev:*js] [!] SyntaxError: The requested module '@rollup/plugin-terser' does not provide an export named 'terser'
[dev:*js] file:///Users/cwebba1/Documents/Prototype_Library/2022_Prototype_Sandbox/PostCSS-Short-Stack/rollup.config.mjs?1673211937516:3

[dev:*js] import { terser } from '@rollup/plugin-terser'
[dev:*js] ^^^^^^
[dev:*js] SyntaxError: The requested module '@rollup/plugin-terser' does not provide an export named 'terser'

@UmamiAppearance
Copy link

UmamiAppearance commented Jan 9, 2023

The plugin uses a default export.

This looks like a named import

[dev:*js] import { terser } from '@rollup/plugin-terser'

Use:

import terser from '@rollup/plugin-terser'

@tada5hi
Copy link
Member

tada5hi commented Jan 9, 2023

@cwebba1 Where did you read about it, to import the plug-in that way ? I’m just asking out of curiosity, because the description must be fixed, if this is somewhere described that way.

@UmamiAppearance
Copy link

UmamiAppearance commented Jan 9, 2023

@tada5hi My guess is, that this is the legacy of the original plugin from @TrySound.

@tada5hi
Copy link
Member

tada5hi commented Jan 10, 2023

@tada5hi My guess is, that this is the legacy of the original plugin from @TrySound.

This might be the reason. Maybe 🤔 we should also support named import/export for the plug-in.

@tada5hi
Copy link
Member

tada5hi commented Jan 10, 2023

@shellscape can you close the issue? Thus, is not actually an issue and I have not the permission to do so ...

@cwebba1
Copy link
Author

cwebba1 commented Jan 11, 2023 via email

@cwebba1
Copy link
Author

cwebba1 commented Jan 11, 2023

Thank you again for your work and your quick response. Issue closed.

@cwebba1 cwebba1 closed this as completed Jan 11, 2023
@tada5hi
Copy link
Member

tada5hi commented Jan 12, 2023

@cwebba1 you are very welcome 😊

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

3 participants