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

npm start fails on windows #108

Closed
dwsmart opened this issue Dec 21, 2021 · 2 comments
Closed

npm start fails on windows #108

dwsmart opened this issue Dec 21, 2021 · 2 comments
Assignees

Comments

@dwsmart
Copy link

dwsmart commented Dec 21, 2021

Hi All,

I tried npm init qwik@latest on a windows 10 machine

Chose the starter, did cd qwik-app npm install

Did npm start, all good so far,

Tried to go to http://localhost:8080 in a browser, this fails, and outputs this in the console

 rollup v2.61.1
[0] bundles src/index.server.qwik.tsx, src/my-app.qwik.tsx → public\build, server\build...
[0] created public\build, server\build in 2.2s
[1]
[1] > qwik-starter-express@0.0.1 serve
[1] > node server/index.js
[1]
[1] http://localhost:8080/
[1] D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:943
[1]         throw new Error(`Not QRL: prop: ${prop}; value: ` + value);
[1]               ^
[1]
[1] Error: Not QRL: prop: on:q-mount; value: async (element, event, url) => {
[1]         const isQwikInternalHook = typeof event == 'string';
[1]         // isQwikInternalHook && console.log('HOOK', event, element, url);
[1]         // `isQwikInternalHook` is a bit of a hack. When events fire we need to treat self as host
[1]         // but if it is regular event than we need to skip us.
[1]         const hostElement = getHostElement(isQwikInternalHook ? element : element.parentElement);
[1]         const props = hostElement && qProps(hostElement);
[1]         const parsedQRL = props && parseQRL(url.toString(), props.__qMap__);
[1]         const state = props && parsedQRL && props['state:' + parsedQRL.getState()];
[1]         const args = parsedQRL && parsedQRL.args;
[1]         return await useInvoke(() => hook(props, state, args), hostElement, event, url);
[1]     }
[1]     at addQrlListener (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:943:15)
[1]     at Object.set (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:828:21)
[1]     at Function.assign (<anonymous>)
[1]     at _reconcileElement (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1356:16)
[1]     at cursorReconcileElement (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1311:16)
[1]     at visitJsxLiteralNode (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1639:27)
[1]     at visitJsxNode (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1583:13)
[1]     at visitJsxNode (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1604:13)
[1]     at visitJsxLiteralNode (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1644:13)
[1]     at visitJsxNode (D:\qwik\qwik-app\server\build\my-app.qwik-de6c5198.js:1583:13)
[1] wait-on public/build && npm run serve exited with code 1

node is version 16.13.1

Am I missing a step? Perhaps windows isn't supported?

@dwsmart dwsmart changed the title npm init qwik@latest fails on windows npm start fails on windows Dec 21, 2021
@mhevery
Copy link
Contributor

mhevery commented Dec 30, 2021

@manucorporat I think this issue is for you.

I have investigated the problem, and it seems that on Windows the Optimizer is bypassed. Not sure as to why but the generated code is the original code without code splitting. Something about Windows file-paths (my guess) must be confusing the optimizer in a way that is preventing it from doing its job.

The failure mode is that the code generated on windows is similar too:

const MyCmp = qComponent({
  onRender: qHook(() => <span>ABC</span>)
})

Whereas the correct code should be:

const MyCmp = qComponent({
  onRender: qHook('./path#symbol')
})

PS: I have created a better error msg for this condition: #127

@igrep
Copy link
Contributor

igrep commented Dec 30, 2021

If I understand the correct result, transforming by the executable qwik.exe doesn't reproduce the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants