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

SyntaxError: Unexpected identifier when importing @iconscout/react-unicons #7913

Closed
brightloudnoise opened this issue Jul 12, 2019 · 4 comments
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@brightloudnoise
Copy link

brightloudnoise commented Jul 12, 2019

Bug report

Describe the bug

SyntaxError: Unexpected identifier when importing @iconscout/react-unicons

Possibly related to #7710

To Reproduce

https://github.com/brightloudnoise/next-unicons-error

Expected behavior

Next should import the module and display the React component for the icon. This works correctly using the same import in recent create-react-app.

System information

  • OS: macOS
  • Chrome and Safari
  • Next.js 9.0.1
@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers help wanted labels Jul 12, 2019
@masives
Copy link
Contributor

masives commented Jul 15, 2019

It's the issue mentioned here #7710 (comment)

Since this library doesn't ship with commonJS you can have NEXT transpile it during build

next.config.js

const withTM = require('next-transpile-modules');

module.exports = withTM({
    transpileModules: ['@iconscout/react-unicons'],
});

This works but I'm not sure what is the cost to this solution.

@brightloudnoise
Copy link
Author

Thanks, that works as a short-term solution.

@timneutkens
Copy link
Member

Closing as same as #706

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants