QwikDev / astro

Qwik + Astro integration
217 stars 13 forks source link

fix: Build fails when outDir (other than the default) does not exist #126

Open thejackshelton opened 5 months ago

thejackshelton commented 5 months ago

fixes #74

changeset-bot[bot] commented 5 months ago

⚠️ No Changeset found

Latest commit: 4db3e6989f16a2baf338aa513fab70479256b856

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

pkg-pr-new[bot] commented 5 months ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@qwikdev/create-astro (4db3e69)

npm i https://pkg.pr.new/QwikDev/astro/@qwikdev/create-astro@126

@qwikdev/astro (4db3e69)

npm i https://pkg.pr.new/QwikDev/astro/@qwikdev/astro@126
thejackshelton commented 5 months ago

I have been using the latest pkg pr new url's in the action to debug this in a consumer project.

image

we can get the build and dev mode working, but preview will fail with the following error:

> serve
> node ./dist/server/entry.mjs

node:internal/modules/cjs/loader:1146
  throw err;
  ^

Error: Cannot find module '/Users/jackshelton/dev/playground/test-outdir/dist/server/entry.mjs'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.12.2

It also creates a folder named dist inside of our custom outDir, which doesn't make any sense.