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

Update cloudflare-module-loader.ts #453

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rishi-raj-jain
Copy link

@rishi-raj-jain rishi-raj-jain commented Nov 28, 2024

Changes

After the build happens with the cloudflare adapter, one of my applications threw error as attached. But the preview ran fine using wrangler. I then noticed then it was failing to read from a file that did not exist in the dist/_worker.js directory. I think this happens because the Astro cleanup happened but it had the older resultant map.

image

Testing

Docs

Copy link

changeset-bot bot commented Nov 28, 2024

🦋 Changeset detected

Latest commit: 0ade1ce

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

This PR includes changesets to release 10 packages
Name Type
@astrojs/cloudflare Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-wasm Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-routes-json Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-wrangler-preview-platform 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

@rishi-raj-jain
Copy link
Author

So I tried to get more context as to why this is occuring, it seems to read a .js file that does not exist while from my adapter's code analysis, it should only have read the .mjs file.
image

Copy link
Member

@alexanderniebuhr alexanderniebuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks okay to me, however I'm not sure if it doesn't hide the real issue.. It should never try to cleanup files, which don't exist anymore.. I'm concerned that we hide something here, which we should investigate in more detail.

@rishi-raj-jain
Copy link
Author

I see, I agree with that. There's something that's why the file is looking for a .js file while the function is intended for a .mjs file. Not sure how can I create a minimal reproducible though, I am working on a large project with Astro and that's where I started seeing this.

@alexanderniebuhr alexanderniebuhr self-assigned this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants