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

Wrangler publish fails on Windows 10 #2

Closed
12932 opened this issue Jul 27, 2020 · 1 comment
Closed

Wrangler publish fails on Windows 10 #2

12932 opened this issue Jul 27, 2020 · 1 comment

Comments

@12932
Copy link

12932 commented Jul 27, 2020

I managed to bypass #1 by deleting the fake Windows 10 python3 (that redirects to Windows Store), and making a copy of python.exe as python3.exe (dirty hack)

However, wrangler publish seems to be failing still

C:\Users\admin\wranglers\pythonhelloworld>wrangler publish
⬇️ Installing wranglerjs...
⬇️ Installing wasm-pack...
 ./index.py
Module not found: Error: Can't resolve './__target__index.js' in 'C:\Users\admin\wranglers\pythonhelloworld'
resolve './__target__index.js' in 'C:\Users\admin\wranglers\pythonhelloworld'
  using description file: C:\Users\admin\wranglers\pythonhelloworld\package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: C:\Users\admin\wranglers\pythonhelloworld\package.json (relative path: ./__target__index.js)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\admin\wranglers\pythonhelloworld\__target__index.js doesn't exist
      .wasm
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.wasm doesn't exist
      .mjs
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.mjs doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.json doesn't exist
      as directory
        C:\Users\admin\wranglers\pythonhelloworld\__target__index.js doesn't exist
[C:\Users\admin\wranglers\pythonhelloworld\__target__index.js]
[C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.wasm]
[C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.mjs]
[C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.js]
[C:\Users\admin\wranglers\pythonhelloworld\__target__index.js.json]
 @ ./index.py 1:0-38 1:0-38
Error: webpack returned an error. Try configuring `entry` in your webpack config relative to the current working directory, or setting `context = __dirname` in your webpack config.
@koeninger
Copy link
Contributor

koeninger commented Jul 31, 2020

The best way to change the python path used by transcrypt-loader is to edit webpack.config.js. I've updated this repo's webpack.config.js to explicitly include the default python3 command, you would need to edit it to the appropriate path on your system (just python -m transcrypt works for me, but ymmv on your python install) .

The issue with __target__index.js is a known issue with transcrypt-loader, with a workaround here TranscryptOrg/Transcrypt#624 (comment)

I'd prefer to see if we can get this fixed appropriately upstream before forking transcrypt-loader, so have linked that workaround from this project's readme for now.

I've tested this working on Windows 10 once webpack.config.js and ./node_modules/transcrypt-loader/__target_es5__/index.js are edited appropriately.

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

2 participants