Closed allevo closed 8 months ago
I tried your starter, set the qwik versions to 1.5.0 and could run pnpm build without issues including the SSG build.
Closing because the issue seems fixed, feel free to add comments if not.
This is not fixed with 1.5.0.
This is the output:
% npm run build.server on main
> build.server
> vite build -c adapters/static/vite.config.ts
vite v5.1.5 building SSR bundle for production...
transforming (1) @qwik-city-plan[vite-plugin-qwik](warn): useVisibleTask$() runs eagerly and blocks the main thread, preventing user interaction until the task is finished. Consider using useTask$(), useOn(), useOnDocument(), or useOnWindow() instead. If you have to use a useVisibleTask$(), you can disable the warning with a '// eslint-disable-next-line qwik/no-use-visible-task' comment.
/Users/allevo/repos/qwik-app/src/routes/demo/flower/index.tsx:19:3
✓ 35 modules transformed.
server/build/q-YWg4fP5u.css 3.68 kB
server/entry.ssr.js 18.51 kB
server/@qwik-city-plan.js 21.21 kB
server/q-BRlvjEAg.js 137.37 kB
✓ built in 2.08s
Starting Qwik City SSG...
Missing client manifest, loading symbols in the client might 404. Please ensure the client build has run and generated the manifest for the server build.
Error during SSG
zn is not iterable (cannot read property Symbol(Symbol.iterator))
Pathname: /
Plugin: qwik-ssg
File: /Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:11:71283
// skip output....
13 | This is because the routeLoader$ was not exported in a 'layout.tsx' or 'index.tsx' file of the existing route.
at od (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:11:71283)
at AsyncFunction.ad (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:11:71713)
at AsyncFunction.Qa (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:10:5887)
at AsyncFunction.te (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:10:5821)
at file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:11:10533
at L (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:7:1606)
at file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:11:10400
at file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:8:4732
at Un (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:7:1526)
at hn (file:///Users/allevo/repos/qwik-app/server/q-BRlvjEAg.js:8:4725)
dist/demo/flower/index.html
error during build:
undefined
The package.json
{
"name": "my-qwik-basic-starter",
"description": "Demo App with Routing built-in (recommended)",
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"engines-annotation": "Mostly required by sharp which needs a Node-API v9 compatible runtime",
"private": true,
"trustedDependencies": [
"sharp"
],
"trustedDependencies-annotation": "Needed for bun to allow running install scripts",
"type": "module",
"scripts": {
"build": "qwik build",
"build.client": "vite build",
"build.preview": "vite build --ssr src/entry.preview.tsx",
"build.server": "vite build -c adapters/static/vite.config.ts",
"build.types": "tsc --incremental --noEmit",
"deploy": "echo 'Run \"npm run qwik add\" to install a server adapter'",
"dev": "vite --mode ssr",
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
"fmt": "prettier --write .",
"fmt.check": "prettier --check .",
"lint": "eslint \"src/**/*.ts*\"",
"preview": "qwik build preview && vite preview --open",
"start": "vite --open --mode ssr",
"qwik": "qwik"
},
"devDependencies": {
"@builder.io/qwik": "^1.5.0",
"@builder.io/qwik-city": "^1.5.0",
"@types/eslint": "^8.56.5",
"@types/node": "^20.11.24",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.57.0",
"eslint-plugin-qwik": "^1.5.0",
"prettier": "^3.2.5",
"typescript": "5.3.3",
"undici": "*",
"vite": "^5.1.4",
"vite-tsconfig-paths": "^4.2.1"
}
}
Your output suggests a different codebase than what you posted as stackblitz?
As mentioned in the additional information, the stackblitz doens't allow me to use the Basic App (Qwik City + Qwik) (Demo App with Routing built-in (recommended))
provided by the CLI. No change is made to the code.
I'm not an expert of stackblitz and I don't know how to "upload" the code there.
@allevo do you have a repo? Stackblitz can load that as is
Yes: https://github.com/allevo/qwik-ssg
the steps:
git clone git@github.com:allevo/qwik-ssg.git
cd qwik-ssg
pnpm install
pnpm run build.server
@allevo
I had the same problem as you, but I got it to work by running pnpm build.client
before running pnpm build.server
!
@wmertens yeah the errors could be better. for SSG you need to have build.client first
@PatrickJS I believe this issue should remain open since it is not resolved; you have only implemented a workaround. It appears this way because the documentation does not mention the necessity of running build.client first.
By the way, I am experimenting the same issue even with the last version 1.5.2
Which component is affected?
Qwik Runtime
Describe the bug
The output of
npm run build.server
is:Instead, I'm expect that works fine.
Reproduction
https://stackblitz.com/edit/qwik-starter-2umwzq?file=package.json
Steps to reproduce
pnpm create astro@latest
.Empty App (Qwik City + Qwik)
.pnpm run qwik add static
npm run build.server
System Info