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

JS files in public folder evaluated after copy and upload #99

Open
traffisco opened this issue Jan 7, 2021 · 1 comment
Open

JS files in public folder evaluated after copy and upload #99

traffisco opened this issue Jan 7, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@traffisco
Copy link
Contributor

traffisco commented Jan 7, 2021

Describe the problem:

Files with JS extension in the public folder are evaluated on yarn deploy.
The folder intended for static files to be uploaded and scripts shouldn't be evaluated.

Link to a minimal reproduction:

https://github.com/traffisco/yarn-bug-test

Added new file test.js with "error" typed in it.

yarn deploy fails with error:
"message": "Uncaught ReferenceError: error is not defined\n at line 22\n"

Files do get copied to out folder and uploaded to KV. Instant workaround is to delete the files from the public folder.

@jplhomer jplhomer added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Jan 8, 2021
@traffisco
Copy link
Contributor Author

traffisco commented Jan 9, 2021

Looks like wrangler publish have a bug with webpack CopyPlugin


Quick fix is to move file copy from webpack to another place like
if (argv._.includes("publish")) {

I can make a PR if you interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants