viclafouch / mui-file-input

A file input designed for the React library MUI
https://viclafouch.github.io/mui-file-input/
MIT License
77 stars 17 forks source link

Version 3.0.2 fails to build with nextjs #44

Closed tecklund closed 10 months ago

tecklund commented 10 months ago

Describe the bug next build fails with the following error:

info  - Collecting page data ./Users/timecklund/git/portal/node_modules/mui-file-input/dist/mui-file-input.es.js:1
import { jsxs as f, jsx as o } 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:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at 70637 (/Users/timecklund/git/portal/.next/server/pages/parents-dashboard/child-info.js:3340:18)
    at __webpack_require__ (/Users/timecklund/git/portal/.next/server/webpack-runtime.js:25:42)

transpilePackages: ['mui-file-input'], did not help

To Reproduce Steps to reproduce the behavior: npm run build to build the nextjs application

Desktop (please complete the following information):

Additional context The problem exists in 3.0.1 and 3.0.2, downgrading to version 3.0.0 fixes the problem

viclafouch commented 10 months ago

Duplicated with https://github.com/viclafouch/mui-file-input/issues/38

tecklund commented 10 months ago

Ah yeah, the issue was an outdated version of next that wasn't using transpilePackages correctly