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

Moving webworker to cockle #19

Closed
ianthomas23 opened this issue Aug 16, 2024 · 2 comments
Closed

Moving webworker to cockle #19

ianthomas23 opened this issue Aug 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ianthomas23
Copy link
Member

Cockle now includes the WebWorker code and handling of separate WASM and JS wrapper files (jupyterlite/cockle#38, jupyterlite/cockle#40, jupyterlite/cockle#44) and I am now trying to use that here, so I have removed the local WebWorker code in branch https://github.com/jupyterlite/terminal/tree/remove-webworker and struggling to get it all correctly working together. Loading the shell_worker.js is failing.

To reproduce it is necessary to use the main branch of cockle as the changes there have not been released yet. So get commit 41cc8b014aa8 of cockle and build it locally following the instructions it its README. If you also follow the instructions for the demo you'll be able to run it locally in a browser and confirm that commands like ls and grep work in the WebWorker. Then run npm link on cockle.

In the same micromamba environment get https://github.com/jupyterlite/terminal/tree/remove-webworker and run jlpm link <relative path to cockle directory>. Then build it in the usual way, you'll need dependencies like jupyterlite-core and so on. To serve use

jupyter lite serve --LiteBuildConfig.extra_http_headers=Cross-Origin-Embedder-Policy=require-corp --LiteBuildConfig.extra_http_headers=Cross-Origin-Opener-Policy=same-origin

When I do this I get

Uncaught (in promise) TypeError: __webpack_modules__[moduleId] is not a function
    at __webpack_require__ (bootstrap:19:1)
    at ../cockle/lib/shell_impl.js (history.ts:73:2)
    at __webpack_require__ (bootstrap:19:1)
    at ../cockle/lib/shell_worker.js (shell_impl.ts:420:2)
    at __webpack_require__ (bootstrap:19:1)
    at bootstrap:34:1
    at __webpack_require__.O (chunk loaded:23:1)
    at __webpack_require__.x (bootstrap:35:1)

in the browser console.

@ianthomas23 ianthomas23 added the enhancement New feature or request label Aug 16, 2024
@ianthomas23
Copy link
Member Author

Now I've released cockle 0.0.7 I've updated this remove-webworker branch to use that, so it is no longer necessary to build cockle from source, just building terminal from this branch is enough.

@ianthomas23
Copy link
Member Author

Closing this as PR #21 is working on a fix.

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

No branches or pull requests

1 participant