Skip to content

Use .mjs extension when building for netlify edge and vercel serverless#6317

Merged
bluwy merged 1 commit intomainfrom
adapter-mjs
Feb 21, 2023
Merged

Use .mjs extension when building for netlify edge and vercel serverless#6317
bluwy merged 1 commit intomainfrom
adapter-mjs

Conversation

@bluwy
Copy link
Member

@bluwy bluwy commented Feb 20, 2023

Changes

Fix #6299

Previously we were using .js only, which might not work if the user doesn't have "type": "module". This adds it and shouldn't break internally when building.

This is only required when they use the prerender feature it seems, because it executes entry.js.

Testing

added test in netlify and vercel

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2023

🦋 Changeset detected

Latest commit: 918a242

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

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 github-actions bot added the pkg: integration Related to any renderer integration (scope) label Feb 20, 2023
"dev": "astro-scripts dev \"src/**/*.ts\"",
"test-fn": "mocha --exit --timeout 20000 test/functions/",
"test-edge": "deno test --allow-run --allow-read --allow-net ./test/edge-functions/",
"test-edge": "deno test --allow-run --allow-read --allow-net --allow-env ./test/edge-functions/",
Copy link
Member Author

Choose a reason for hiding this comment

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

This addition is needed for the test to run, as the adapter executes Deno.env.toObject()

Copy link
Member

@MoustaphaDev MoustaphaDev left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vercel Serverless - astro build fails with "Cannot use import statement outside a module"

3 participants