You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a directory exists in public with the same name as a page and a qwik component exists anywhere in the project, that page is not showing up in the final build.
To reproduce
npm create astro@latest (Empty, with Typescript in Strict mode)
npx astro add @qwikdev/astro and modify tsconfig.json according to the documentation
Create a page (e.g., cp src/pages/index.astro src/pages/some_page.astro)
Create a directory in public with same name (e.g., mkdir public/some_page)
Create a qwik-component anywhere (e.g., a hello world component in src/component.tsx)
Build (npm run build) and observe that some_page is missing from the build in dist
The page will show up in the build again when either the directory in public is deleted or all qwik components are removed
A simple fix would be to replace fsExtra.move with fsExtra.copy, as this seems to merge the directories correctly (at the cost of having to duplicate the data).
This merging-behavior for fsExtra.move was discussed in jprichardson/node-fs-extra#668, but apparently only implemented in a separate package.
Depending on how you would want to resolve this issue, I can look into creating a pull-request if you want.
The text was updated successfully, but these errors were encountered:
Hey @FloezeTv! I was able to reproduce the issue given your detailed steps. We've also had our fair share of weird issues with the build files being moved, especially with Astro's deployment adapters, which I wonder if this could help resolve as well.
Interesting, the package does appear to have a test suite, I wonder if it being cjs would potentially cause any issues (especially with vite's whole esm change)
A PR would be awesome 😄 . Happy to review it asap.
FloezeTv
added a commit
to FloezeTv/qwik-astro
that referenced
this issue
Mar 12, 2024
When a directory exists in
public
with the same name as a page and a qwik component exists anywhere in the project, that page is not showing up in the final build.To reproduce
npm create astro@latest
(Empty, with Typescript in Strict mode)npx astro add @qwikdev/astro
and modifytsconfig.json
according to the documentationcp src/pages/index.astro src/pages/some_page.astro
)public
with same name (e.g.,mkdir public/some_page
)src/component.tsx
)npm run build
) and observe thatsome_page
is missing from the build indist
public
is deleted or all qwik components are removedReason
During build, files/directories from
dist
are moved to a temp-directory. At this time, it seems the files frompublic
already exists indist
but the pages have not been built yet.Then, qwik runs its build in that temp-directory and astro builds the static pages in the
dist
-directory.Qwik then moves all files/directories directly in the temp-directory back to the
dist
-directory.In this case, this overwrites the generated page in the
some_page
-directory with the previously moved version from thepublic
-directory.A simple fix would be to replace
fsExtra.move
withfsExtra.copy
, as this seems to merge the directories correctly (at the cost of having to duplicate the data).This merging-behavior for
fsExtra.move
was discussed in jprichardson/node-fs-extra#668, but apparently only implemented in a separate package.Depending on how you would want to resolve this issue, I can look into creating a pull-request if you want.
The text was updated successfully, but these errors were encountered: