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

v2 - Error: Got unexpected undefined #8372

Closed
uragecz opened this issue Aug 6, 2022 · 3 comments
Closed

v2 - Error: Got unexpected undefined #8372

uragecz opened this issue Aug 6, 2022 · 3 comments

Comments

@uragecz
Copy link

uragecz commented Aug 6, 2022

🐛 bug report

Trying to update parcel to v2 in our big project, however seems that building performance went noticeably down and mostly important that we get random errors that doesn't tell us anything, these error disappears after removing cache but appears after some time of running.. We are using Parcel API

const bundler = new Parcel({
    entries: Path.resolve(root, `./frontend/${appName}/src/index.html`),
    defaultConfig: '@parcel/config-default',
    defaultTargetOptions: {
      distDir: Path.join(root, `./dist/${appName}`),
    },
  })

  new Promise((resolve, reject) => {
    bundler.watch((err, event) => {
      if (err) {
        // fatal error
        throw err
      }
  
      if (event && event.type === 'buildSuccess') {
        const bundles = event.bundleGraph.getBundles();
        console.log(`✨ Built ${bundles.length} bundles in ${event.buildTime}ms!`);
        resolve(true)
      } else if (event && event.type === 'buildFailure') {  
        reject(event);
      }
    })
  }).then(() => {
    console.log('start server');
    startServe(options)
  }, (err) => {
    console.log('fail to build', err);
  })

Error :

node_modules/nullthrows/nullthrows.js:7
  var error = new Error(message !== undefined ? message : 'Got unexpected ' + x);
              ^
Error: Got unexpected undefined
    at nullthrows (../node_modules/nullthrows/nullthrows.js:7:15)
    at Object.run (../node_modules/@parcel/core/lib/requests/DevDepRequest.js:133:54)
    at RequestTracker.runRequest (../node_modules/@parcel/core/lib/RequestTracker.js:725:34)
    at Object.runRequest (../node_modules/@parcel/core/lib/RequestTracker.js:777:23)
    at runDevDepRequest (../node_modules/@parcel/core/lib/requests/DevDepRequest.js:127:13)
    at runCompressor (../node_modules/@parcel/core/lib/requests/WriteBundleRequest.js:237:47)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at writeFiles (../node_modules/@parcel/core/lib/requests/WriteBundleRequest.js:207:3)
    at Object.run (../node_modules/@parcel/core/lib/requests/WriteBundleRequest.js:179:3)
    at RequestTracker.runRequest (../node_modules/@parcel/core/lib/RequestTracker.js:725:20)

🎛 Configuration (.babelrc, package.json, cli command)

We use default parcel configuration + adding @babel/plugin-transform-react-jsx and babel-plugin-module-resolver
relative libraries versions -

{
  "parcel": "^2.7.0",
  "@parcel/packager-raw-url": "^2.7.0",
  "@parcel/transformer-sass": "^2.7.0",
  "@parcel/transformer-webmanifest": "^2.7.0",
  "typescript": "^4.7.4",
}

🤔 Expected Behavior

If there is some error, it should tell us where is the problem.

😯 Current Behavior

Really hard to debug since there is no clue of possible cause

💁 Possible Solution

🔦 Context

Trying to migrate to v2

💻 Code Sample

Since we are migrating big project, there is hard to find the cause so there is no any code sample what is causing the error. On v1 everything went good so far.

🌍 Your Environment

Software Version(s)
Parcel 2.7.0
Node 16.16.0
npm/Yarn 8.1.2
Operating System macOS Monterey 12.4
@HcroakerDev
Copy link

Still getting this issue on parcel v2.8.0. Anyone have any idea how to fix?

@mischnic
Copy link
Member

mischnic commented Dec 7, 2022

Looks like a duplicate of #8375

@mischnic mischnic closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
@Aneeshaik
Copy link

Still getting this issue on parcel v2.8.0. Anyone have any idea how to fix?

Did you fix it?

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