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: Cannot use import statement outside a module, NEXTJS 14.2.3 #37

Closed
darkdiesel opened this issue Jun 20, 2024 · 3 comments
Closed

Comments

@darkdiesel
Copy link

darkdiesel commented Jun 20, 2024

Using sample example from your docs and get error .


SyntaxError: Cannot use import statement outside a module
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
file:/var/www/admin-panel.loc/node_modules/mui-color-input/dist/mui-color-input.es.js (1)
Next.js
mui-color-input
file:/var/www/admin-panel.loc/.next/server/pages/settings.js (1798:18)
Next.js
eval
/src/pages/settings/index.tsx
./src/pages/settings/index.tsx
file:/var/www/admin-panel.loc/.next/server/pages/settings.js (1180:1)
Next.js```
@sankaran85
Copy link

facing same issue in nextjs .. import { MuiColorInput } from 'mui-color-input'

@Kaaaaii
Copy link

Kaaaaii commented Jun 28, 2024

same issue here

@viclafouch
Copy link
Owner

Hello !

Try this :

/** @type {import('next').NextConfig} */
const nextConfig = {
  transpilePackages: ['mui-color-input'],
}
 
module.exports = nextConfig

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

4 participants