viclafouch / mui-tel-input

📌 A phone number input designed for MUI (Material ui) V6 built with libphonenumber-js
https://viclafouch.github.io/mui-tel-input
MIT License
158 stars 65 forks source link

v4 triggers SyntaxError: Cannot use import statement outside a module #110

Closed waacton closed 9 months ago

waacton commented 9 months ago

Wouldn't be surprised if I was doing something wrong, but from version 4.0.0 onwards I get an error from: import { MuiTelInput } from 'mui-tel-input'

⨯ [path]\node_modules\mui-tel-input\dist\mui-tel-input.es.js:1
import { jsxs as _, jsx as p, Fragment as Fe } from "react/jsx-runtime";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1153:20)
    at Module._compile (node:internal/modules/cjs/loader:1205:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at mod.require ([path]\node_modules\next\dist\server\require-hook.js:64:28)
    at require (node:internal/modules/helpers:130:18)
    at mui-tel-input ([path]\.next\server\pages\index.js:329:18)

There is no error when I revert back to version 3.2.2.

I'm also using react 18, mui/material 5, and next 14.

waacton commented 9 months ago

Oops, nevermind, I see it's already reported and not planned to fix (https://github.com/viclafouch/mui-tel-input/issues/84)