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

fix: exit dev if build fails on first run #734

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

threepointone
Copy link
Contributor

Because of evanw/esbuild#1037, we can't recover dev if esbuild fails on first run. The workaround is to end the process if it does so, until we have a better fix.

Reported in #731

Because of evanw/esbuild#1037, we can't recover dev if esbuild fails on first run. The workaround is to end the process if it does so, until we have a better fix.

Reported in #731
@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2022

🦋 Changeset detected

Latest commit: 8102d0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2068802363/npm-package-wrangler-734

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/734/npm-package-wrangler-734

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2068802363/npm-package-wrangler-734 dev path/to/script.js

@threepointone threepointone merged commit a1dadac into main Mar 31, 2022
@threepointone threepointone deleted the exit-on-first-esbuild-fail branch March 31, 2022 10:01
@petebacondarwin
Copy link
Contributor

Not related to this PR but we currently don't format the error message from esbuild during a rebuild as nicely as we could...

After this PR we get the following output when failing first time:

✘ [ERROR] Expected identifier but found "("

    packages/example-worker-app/src/index.js:4:12:
      4 │     console.(
        ╵             ^

Build failed with 1 error:
packages/example-worker-app/src/index.js:4:12: ERROR: Expected identifier but found "("

But if we fail during a rebuild we get:

✘ [ERROR] Expected identifier but found "("

    packages/example-worker-app/src/index.js:4:12:
watch build failed: Error: Build failed with 1 error:
packages/example-worker-app/src/index.js:4:12: ERROR: Expected identifier but found "("
    at failureErrorWithLog (/Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:1602:15)
    at /Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:1309:39
    at runOnEndCallbacks (/Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:1033:63)
    at /Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:1306:17
    at handleRequest (/Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:729:15)
    at handleIncomingPacket (/Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:755:7)
    at Socket.readFromStdout (/Users/pbacondarwin/dev/wrangler2/node_modules/esbuild/lib/main.js:632:7)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
    at addChunk (node:internal/streams/readable:315:12) {
  errors: [
    {
      detail: undefined,
      location: [Object],
      notes: [],
      pluginName: '',
      text: 'Expected identifier but found "("'
    }
  ],
  warnings: []
}

@threepointone
Copy link
Contributor Author

Dropped a link to your comment in #377

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

Successfully merging this pull request may close these issues.

2 participants