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

Add ipython #1110

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
aa09f15
Create draft PR for #936
create-issue-branch[bot] Feb 27, 2024
8814cae
default to pyodide and switch to skulpt if needed
loiswells97 Feb 27, 2024
1f0e5d0
attempt to parse imports in the runnerfactory
loiswells97 Feb 27, 2024
12bdce4
refactoring
loiswells97 Feb 28, 2024
f0ba6c3
tidying for linter
loiswells97 Feb 28, 2024
825961e
tidying to clarify approach in pr
loiswells97 Feb 28, 2024
e4354ed
refactoring to fix things
loiswells97 Feb 28, 2024
534871c
tidying
loiswells97 Feb 28, 2024
fb17e4d
tidying
loiswells97 Feb 29, 2024
7a3a74c
Merge branch 'main' into issues/936-Spike_Investigate_using_pyodide_d…
loiswells97 Feb 29, 2024
e69126c
Merge branch 'main' into issues/936-Spike_Investigate_using_pyodide_d…
loiswells97 Feb 29, 2024
edabb66
Merge branch 'main' into issues/936-Spike_Investigate_using_pyodide_d…
loiswells97 Feb 29, 2024
ff0587f
fixing shikm assets
loiswells97 Apr 4, 2024
73ae099
Merge branch 'main' into issues/936-Spike_Investigate_using_pyodide_d…
loiswells97 Apr 4, 2024
beaad38
initial attempt at explaining incompatible modules
loiswells97 Apr 4, 2024
901cd1d
Fixing snapshot and skulptrunner tests
loiswells97 Apr 4, 2024
88ce726
fixing pyodiderunner tests
loiswells97 Apr 4, 2024
ea622af
fixing py5 imported mode
loiswells97 Apr 4, 2024
95b85ab
fixing cypress tests
loiswells97 Apr 4, 2024
ef868e0
updating snapshot
loiswells97 Apr 4, 2024
f9d8b67
fixing linting warning
loiswells97 Apr 5, 2024
610f6ad
updating changelog
loiswells97 Apr 5, 2024
e399def
fixing the input function
loiswells97 Apr 5, 2024
797a559
trying to fix cypress
loiswells97 Apr 5, 2024
691f9fb
patching pygal tooltip formatter
loiswells97 Apr 8, 2024
b1683fe
couple of regex patches to eliminate some edge cases
loiswells97 Apr 8, 2024
f76ea51
tidying
loiswells97 Apr 8, 2024
fdc914d
moving pyodiderunner back for now to avoid conflicts
loiswells97 Apr 8, 2024
52c4067
Merge branch 'main' into issues/936-Spike_Investigate_using_pyodide_d…
loiswells97 Apr 8, 2024
1b82f42
tidying
loiswells97 Apr 8, 2024
68d85dc
changing and fixing tests
loiswells97 Apr 9, 2024
41594e6
fixing more tests
loiswells97 Apr 9, 2024
a571b06
fix mission zero tests
loiswells97 Apr 9, 2024
ce79754
testing pythonrunner switching which runner is active
loiswells97 Apr 9, 2024
70d1eea
updating snapshot
loiswells97 Apr 9, 2024
e53a055
tweaking and testing skulpt and pyodide runner visibilities
loiswells97 Apr 9, 2024
868ab31
tweaking incompatibility error message explanation
loiswells97 Apr 9, 2024
d2fcfc3
fix one of the mission zero cypress tests
loiswells97 Apr 10, 2024
a73fcad
update error explanation copy
loiswells97 Apr 10, 2024
bdb30a1
switching turtle to skulpt and forcing skulpt if sense hat always ena…
loiswells97 Apr 10, 2024
5d43c1a
update error explanation to include turtle
loiswells97 Apr 10, 2024
8e8bdc9
updating snapshot
loiswells97 Apr 10, 2024
e45e8e3
switching mission zero cypress port
loiswells97 Apr 10, 2024
d9b38f3
Merge branch 'pyodide-migration' into issues/936-Spike_Investigate_us…
sra405 Apr 29, 2024
73981ea
Merge pull request #937 from RaspberryPiFoundation/issues/936-Spike_I…
sra405 May 31, 2024
410b3d2
Merge branch 'main' into pyodide-migration
sra405 May 31, 2024
d93fd44
renaming and moving files temporarily to try and simplify the merge c…
loiswells97 Oct 1, 2024
8512211
Merge branch 'main' into pyodide-migration
loiswells97 Oct 1, 2024
09a9c60
reverting and fixing a few things post merge
loiswells97 Oct 1, 2024
cf403ca
some test fixing
loiswells97 Oct 1, 2024
3a50dc3
trying to fix cypress tests
loiswells97 Oct 3, 2024
34fed91
remove lingering only from cypress tests
loiswells97 Oct 3, 2024
efd0544
be more defensive looping over project components
loiswells97 Oct 3, 2024
19be64a
Matplotlib support (#1087)
loiswells97 Oct 8, 2024
17dfe0a
Fix dynamic pyodide switching with multiple files (#1097)
create-issue-branch[bot] Oct 9, 2024
41ef481
Web component pyodide support (#1090)
loiswells97 Oct 10, 2024
e582b65
Bump pyodide to latest version (#1098)
create-issue-branch[bot] Oct 11, 2024
a28999d
feat(pocs): initial trials and getting the wc working on 3011 and 301…
sra405 Oct 15, 2024
b32205f
Webpack v5 bump (#1096)
loiswells97 Oct 15, 2024
75878f1
Merge branch 'pyodide-migration' into pyodide-headers-webpack-4
sra405 Oct 15, 2024
de5068d
working PyodideWorker
sra405 Oct 15, 2024
60c9c3f
refactor(pyodide-libraries): restructure `public` directory to ensure…
sra405 Oct 16, 2024
a674de4
fix(PyodideWorker): made an error with the refactor
sra405 Oct 16, 2024
732c77e
general tidy up
sra405 Oct 16, 2024
5f2998a
fix(PyodideWorker): minor fixes needed after tidy up and refactor
sra405 Oct 16, 2024
28a493a
PyodideRunner - remove console log
sra405 Oct 16, 2024
c0213cd
initial console functionality
loiswells97 Oct 16, 2024
5feae09
fixing autorun
loiswells97 Oct 16, 2024
be7fe9a
adding iframe console into actual editor and getting it autorunning w…
loiswells97 Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(pocs): initial trials and getting the wc working on 3011 and 301…
…2 (standalone) - currently failing
  • Loading branch information
sra405 committed Oct 15, 2024

Verified

This commit was signed with the committer’s verified signature.
pawanjay176 Pawan Dhananjay
commit a28999dfb80a58363f2a6b147fe9b7a32d57bdc9
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@ REACT_APP_PLAUSIBLE_DATA_DOMAIN=''
REACT_APP_PLAUSIBLE_SOURCE=''
REACT_APP_SENTRY_DSN=''
REACT_APP_SENTRY_ENV='local'
PUBLIC_URL='http://localhost:3010'
PUBLIC_URL='http://localhost:3011'
ASSETS_URL='http://localhost:3010'
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3010",
"url": "http://localhost:3011",
"webRoot": "${workspaceFolder}"
}
]
40 changes: 40 additions & 0 deletions public/PyodideServiceWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
self.addEventListener("install", () => {
self.skipWaiting();
});

self.addEventListener("activate", (event) => {
event.waitUntil(self.clients.claim());
});

self.addEventListener("fetch", (event) => {
if (
event.request.cache === "only-if-cached" &&
event.request.mode !== "same-origin"
) {
return;
}

console.log(event.request);

const interceptedRequests = ["pyodide"];

if (interceptedRequests.some((str) => event.request.url.includes(str))) {
event.respondWith(
fetch(event.request)
.then((response) => {
console.log(`Intercepted: ${event.request.url}`);

const body = response.body;
const status = response.status;
const headers = new Headers(response.headers);
const statusText = response.statusText;

headers.set("Cross-Origin-Embedder-Policy", "require-corp");
headers.set("Cross-Origin-Opener-Policy", "same-origin");

return new Response(body, { status, statusText, headers });
})
.catch(console.error),
);
}
});
9 changes: 8 additions & 1 deletion src/PyodideWorker.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ const PyodideWorker = () => {
importScripts("https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js");

const supportsAllFeatures = typeof SharedArrayBuffer !== "undefined";
console.log(`crossOriginIsolated: ${globalThis.crossOriginIsolated}`);

// eslint-disable-next-line no-restricted-globals
if (!supportsAllFeatures && name !== "incremental-features") {
@@ -361,9 +362,15 @@ const PyodideWorker = () => {
};

globalThis.PyodideWorker = PyodideWorker;
// globalThis = {
// postMessage,
// onmessage,
// };

if (typeof module !== "undefined") {
module.exports = {
PyodideWorker,
PyodideWorker: PyodideWorker,
// postMessage,
// onmessage,
};
}
Original file line number Diff line number Diff line change
@@ -20,8 +20,84 @@
import { SettingsContext } from "../../../../../utils/settings";
import RunnerControls from "../../../../RunButton/RunnerControls";

// import { PyodideWorker } from "worker-plugin/loader!../../../../../PyodideWorker";

/**
* A Worker that can be run on a different origin by respecting CORS
* By default, a Worker constructor that uses an url as its parameters ignores CORS
* and fails on a different origin.
* This way we can run web worker on scripts served by a CDN
*/
export class CorsWorker {
/**
* @param {string | URL} url - worker script URL
* @param {WorkerOptions} [options] - worker options
*/
constructor(url, options) {
this.url = url;
this.options = options;
const absoluteUrl = new URL(url, window.location.href).toString();
const workerSource = `\
/* global PyodideWorker */
const urlString = ${JSON.stringify(absoluteUrl)}
const originURL = new URL(urlString)
const originalImportScripts = self.importScripts
self.importScripts = (url) => {
try {
originalImportScripts.call(self, new URL(url, originURL).toString())
} catch (e) {
console.error('Failed to import script:', url, e);
throw e;
}
}
importScripts(urlString);
const pyodide = PyodideWorker();
`;
const blob = new Blob([workerSource], { type: "application/javascript" });
const objectURL = URL.createObjectURL(blob);
this.worker = new Worker(objectURL, options);
URL.revokeObjectURL(objectURL);

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:32:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:32:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:63:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:63:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:63:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:107:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:125:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:144:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:164:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 59 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / test

TypeError: URL.revokeObjectURL is not a function at new revokeObjectURL (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:59:9) at PyodideRunner (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx:120:21) at Component (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at renderWithHooks (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at mountIndeterminateComponent (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at beginWork$1 (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at performUnitOfWork (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at workLoopSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at renderRootSync (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at recoverFromConcurrentError (/home/runner/work/editor-ui/editor-ui/node_modules/react-dom/cjs/react-dom.development.js:25750:22) at callback (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2667:24) at flushActQueue (/home/runner/work/editor-ui/editor-ui/node_modules/react/cjs/react.development.js:2582:11) at actImplementation (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/act-compat.js:63:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:159:25) at renderRoot (/home/runner/work/editor-ui/editor-ui/node_modules/@testing-library/react/dist/pure.js:246:10) at Object.<anonymous> (/home/runner/work/editor-ui/editor-ui/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.test.js:164:11) at Promise.then.completed (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:293:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/utils.js:226:10) at _callCircusHook (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:262:40) at _runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:227:5) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:135:9) at _runTestsForDescribeBlock (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:130:9) at run (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/run.js:68:3) at runAndTransformResultsToJestFormat (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/editor-ui/editor-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:74:19) at runTestInternal (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/editor-ui/editor-ui/node_modules/jest-runner/build/testWorker.js:106:12)
}

getWorker() {
return this.worker;
}

async createWorker() {
const f = await fetch(this.url);
const t = await f.text();
const b = new Blob([t], {
type: "application/javascript",
});
const url = URL.createObjectURL(b);
const worker = new Worker(url, this.options);
return worker;
}

/*
The notes here are outside workerSource to not increase the ObjectURL size with
long explanations as comments

Note 1
======
Sometimes Webpack will try to import url with "blob:" prefixed and with relative
path as absolute path.

Not only this will cause a security error due to different url, such as a "blob:"
protocol (meaning a CORS error), the path will be wrong. Any of those 2 problems
fails the importScripts. Since we can import JS with blobs, lets just remove "blob:"
prefix and fix the URL its content is a valid URL

Note 2
======
URL#pathname always starts with "/", we want to remove the / to be a relative path
to the Worker file URL

*/
}

const PyodideRunner = ({ active }) => {
const getWorkerURL = (url) => {

Check warning on line 100 in src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx

GitHub Actions / lint

'getWorkerURL' is assigned a value but never used
const content = `
/* global PyodideWorker */
console.log("Worker loading");
@@ -33,9 +109,27 @@
return URL.createObjectURL(blob);
};

const workerUrl = getWorkerURL(`${process.env.PUBLIC_URL}/PyodideWorker.js`);
// Blob approach - works in web component but not in the editor
// Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:3011/PyodideWorker.js' failed to load.
// const workerUrl = getWorkerURL(`${process.env.PUBLIC_URL}/PyodideWorker.js`);
// const pyodideWorker = useMemo(() => new Worker(workerUrl), []);

// CORS worker - works in web component but not in the editor
// Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:3012/en/projects/PyodideWorker.js' failed to load.
// const workerUrl = new CorsWorker("./PyodideWorker.js", {
const workerUrl = new CorsWorker(
`${process.env.PUBLIC_URL}/PyodideWorker.js`,
// {
// type: "classic",
// },
);
const pyodideWorker = useMemo(() => workerUrl.getWorker(), []);

const pyodideWorker = useMemo(() => new Worker(workerUrl), []);
// DOESN'T WORK
// const pyodideWorker = await workerUrl.createWorker();
// const pyodideWorker = useMemo(() => workerUrl.createWorker(), []);
// const pyodideWorker = useMemo(() => new Worker(PyodideWorker), []);
// const pyodideWorker = useMemo(() => new Worker(`./PyodideWorker.js`, []));

if (!pyodideWorker) {
console.error("PyodideWorker is not initialized");
@@ -65,6 +159,26 @@
const [visuals, setVisuals] = useState([]);
const [showRunner, setShowRunner] = useState(active);

// useEffect(() => {
// console.log("trying registering service worker");
// if ("serviceWorker" in navigator) {
// console.log("registering service worker");
// navigator.serviceWorker
// .register("./PyodideServiceWorker.js")
// // .register(`${process.env.PUBLIC_URL}/PyodideServiceWorker.js`)
// // .register(`${window.location.origin}/PyodideServiceWorker.js`)
// // .register(serviceWorker)
// // .register(getBlobURL(serviceWorker, "application/javascript"))
// // .register(serviceWorkerUrl)
// .then((registration) => {
// if (!registration.active || !navigator.serviceWorker.controller) {
// console.log("registered");
// window.location.reload();
// }
// });
// }
// }, []);

useEffect(() => {
if (pyodideWorker) {
pyodideWorker.onmessage = ({ data }) => {
Loading
Loading