parcel-bundler / parcel

The zero configuration build tool for the web. πŸ“¦πŸš€
https://parceljs.org
MIT License
43.4k stars 2.26k forks source link

Can't build project using 1.10.0-beta.1 #2052

Closed scrossan-crown closed 5 years ago

scrossan-crown commented 6 years ago

πŸ› bug report

πŸŽ› Configuration (.babelrc, package.json, cli command)

.babelrc
{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react"
  ],
  "plugins": [
    [
      "@babel/plugin-transform-runtime",
      {
        "regenerator": true
      }
    ]
  ]
}

πŸ€” Expected Behavior

Should build my app into production code (which it did previous to the beta version)

😯 Current Behavior

🚨  /app/node_modules/react-toastify/dist/ReactToastify.css:undefined:undefined: Cannot find module 'browserslist'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
    at Function.Module._load (internal/modules/cjs/loader.js:497:25)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (/app/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/app/node_modules/postcss-minify-params/dist/index.js:7:21)
    at Module._compile (/app/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)

πŸ’ Possible Solution

πŸ”¦ Context

Command run npx parcel build main.tsx -d public/js

πŸ’» Code Sample

🌍 Your Environment

Software Version(s)
Parcel 1.10.0-beta.1
Node 10.0.0
npm/Yarn 6.2.0
Operating System Linux / Node:1.0.0 Docker container
scrossan-crown commented 6 years ago

Installing browserslist package manually fixed the issue

scrossan-crown commented 6 years ago

After getting the project to build i get the following error in the console that wasn't there previously

hoist-non-react-statics.cjs.js:31 Uncaught Error: Cannot find module 'MOM9'
    at u (hoist-non-react-statics.cjs.js:31)
    at u (account.8730b2f1.js:1)
    at p (account.8730b2f1.js:1)
    at Object.parcelRequire.vRc9.@babel/runtime/helpers/interopRequireDefault (AttachMoney.js:3)
    at u (account.8730b2f1.js:1)
    at p (account.8730b2f1.js:1)
    at Object.parcelRequire.8I/B.@babel/runtime/helpers/classCallCheck (account.tsx:15)
    at u (account.8730b2f1.js:1)
    at parcelRequire.vRc9.@babel/runtime/helpers/interopRequireDefault (account.8730b2f1.js:1)
    at account.8730b2f1.js:1
scrossan-crown commented 6 years ago

Just as a note it's working perfectly in development

DeMoorJasper commented 6 years ago

Please try 1.10.1

scrossan-crown commented 6 years ago

I've tired 1.10.1 and it's not having the above error but is now having a completely different error when building.

Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
scrossan-crown commented 6 years ago

I'm not sure if it helps but I've changed one route component to import the component directly instead of using react-loadable and async imports and it works perfectly

DeMoorJasper commented 6 years ago

@scrossan-crown well that looks like a react error. If that also happens in a dev build it’s a bug in your code

Sent with GitHawk

scrossan-crown commented 6 years ago

@DeMoorJasper the issue is that there are no errors in the dev build but the production build is broken as of 1.10.0-beta.1

DeMoorJasper commented 6 years ago

Not sure if I’ll be able to do anything without a minimal reprodcuable example. It seems to be a minification issue but we didn’t change any minification in 1.10 afaik

Sent with GitHawk

scrossan-crown commented 6 years ago

Ok, I’ll have a play around and try to get a reproducible example up and running.

scrossan-crown commented 5 years ago

I think I've found the error, it was a case of the localStorage containing some incorrect data. Thanks for your suggestions and help