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: support Windows line-endings in TOML files #936

Merged

Conversation

petebacondarwin
Copy link
Contributor

The TOML parser that Wrangler uses crashes if there is a Windows line-ending in a comment.
See iarna/iarna-toml#33.

According to the TOML spec, we should be able to normalize line-endings as we see fit.
See https://toml.io/en/v1.0.0#:~:text=normalize%20newline%20to%20whatever%20makes%20sense.

This change normalizes line-endings of TOML strings before parsing to avoid hitting this bug.

Fixes #915

The TOML parser that Wrangler uses crashes if there is a Windows line-ending in a comment.
See iarna/iarna-toml#33.

According to the TOML spec, we should be able to normalize line-endings as we see fit.
See https://toml.io/en/v1.0.0#:~:text=normalize%20newline%20to%20whatever%20makes%20sense.

This change normalizes line-endings of TOML strings before parsing to avoid hitting this bug.

Fixes cloudflare#915
@changeset-bot
Copy link

changeset-bot bot commented May 9, 2022

🦋 Changeset detected

Latest commit: 6fc553a

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

github-actions bot commented May 9, 2022

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/2293874668/npm-package-wrangler-936

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

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

Or you can use npx with this latest build directly:

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

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.

🐛 BUG: CRLF line endings in comments causes an error
2 participants