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

windows path #12

Closed
lencx opened this issue Jul 5, 2021 · 6 comments
Closed

windows path #12

lencx opened this issue Jul 5, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@lencx
Copy link
Member

lencx commented Jul 5, 2021

Because I don’t have a windows computer, you may need to verify it for me. Thanks 🙏

#8 (comment)

@lencx lencx added the bug Something isn't working label Jul 5, 2021
lencx added a commit that referenced this issue Jul 5, 2021
@husayt
Copy link

husayt commented Jul 5, 2021

Hi @lencx , thanks for patch. This partially fixes it. But there are two issues

  1. When I have two wasm imports in one page first one of them works and with second one I get the same url error. When I
    have just one it all works fine

for example here, whichever the second one, it will give error

import init from "@rsw/hey"
import init2, { greet as greet2 } from "rsw-test"
  1. I also get this message in console, not sure if it is ok:

wasm.4e83ef3d.js:1 WebAssembly.instantiateStreaming failed because your server does not serve wasm with application/wasm MIME type. Falling back to WebAssembly.instantiate which is slower. Original error:
TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
(anonymous) @ wasm.4e83ef3d.js:1
async function (async)
(anonymous) @ wasm.4e83ef3d.js:1
e @ wasm.4e83ef3d.js:1
async function (async)
e @ wasm.4e83ef3d.js:1
(anonymous) @ wasm.4e83ef3d.js:1
vendor.9e7a6d01.js:26 [Violation] 'click' handler took 1521ms

@lencx
Copy link
Member Author

lencx commented Jul 5, 2021

This does not seem to be a plugin problem, you can try to run rsw && vite build --force or npm run dev --force.

@husayt
Copy link

husayt commented Jul 5, 2021

Dev works fine, the issue is only with build. Maybe it is latest vite, I will try again

@lencx
Copy link
Member Author

lencx commented Jul 5, 2021

Okay, looking forward to your feedback.

@lencx lencx changed the title [bug]: windows path windows path Jul 6, 2021
@lencx lencx closed this as completed Jul 7, 2021
@husayt
Copy link

husayt commented Jul 7, 2021

@lencx i just tried again and get the same. First one works fine and with second one I get:

wasm.20b16b66.js:1 Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL
    at n (wasm.20b16b66.js:1)
    at wasm.20b16b66.js:1

Also when I try with vite-SSG, i get this error during build:

[vite-plugin-pwa] `new URL(url, import.meta.url)` is not supported in SSR.
file: C:/ui-playground/rsw-test/pkg/rsw-test.js:116:16
114: async function init(input) {
115:     if (typeof input === 'undefined') {
116:         input = new URL('rsw-test_bg.wasm', import.meta.url);
                     ^
117:     }
118:     const imports = {};
Error: `new URL(url, import.meta.url)` is not supported in SSR.
    at error (C:\ui-playground\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:164:30)
    at throwPluginError (C:\ui-playground\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:19277:12)
    at Object.error (C:\ui-playground\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:19926:20)
    at Object.error (C:\ui-playground\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:19453:38)
    at Object.transform (C:\ui-playground\node_modules\.pnpm\v[email protected]\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:50723:30)     
    at Object.<anonymous> (C:\ui-playground\node_modules\.pnpm\v[email protected]\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:51204:33)   
    at C:\ui-playground\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:20131:25 {
  pos: 3247,

@lencx
Copy link
Member Author

lencx commented Jul 8, 2021

@husayt Please install v1.6.5, the problem (#13) of improt.meta.url has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants