Skip to content

Next.js: SyntaxError: Unexpected token 'export' #18

Answered by ilyabo
proclamo asked this question in Q&A
Discussion options

You must be logged in to vote

next-transpile-modules should solve this issue with Next.js.

Add this to next.config.js:

const withTM = require('next-transpile-modules')([
  '@flowmap.gl/layers',
  '@flowmap.gl/data',
]);


module.exports = withTM({
  // ... rest of the config
});

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ilyabo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #12 on January 15, 2023 11:51.