hermann on Sun, 26 May 2024 00:47:04 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Making use of "GP in your browser" questions


On 2024-05-26 00:27, Bill Allombert wrote:

But you should be able to use
https://pari.math.u-bordeaux.fr/gpjswasm/gp-sta.js
or I misunderstand ?

Sorry, no, that does not work.

Not with "http:" (only for local resources), tells that I should use "https:" :

hermann@j4105:~/gpminimal$ node --experimental-network-imports
Welcome to Node.js v20.13.1.
Type ".help" for more information.
(node:9227) ExperimentalWarning: Network Imports is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

await import("http://pari.math.u-bordeaux.fr/gpjswasm/gp-sta.js";)
Uncaught:
[Error [ERR_NETWORK_IMPORT_DISALLOWED]: import of 'http://pari.math.u-bordeaux.fr/gpjswasm/gp-sta.js' by undefined is not supported: http can only be used to load local resources (use https instead).] {
  code: 'ERR_NETWORK_IMPORT_DISALLOWED'
}



Not with "https:" either ...

hermann@j4105:~/gpminimal$ node --experimental-network-imports
Welcome to Node.js v20.13.1.
Type ".help" for more information.
(node:9269) ExperimentalWarning: Network Imports is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

await import("https://pari.math.u-bordeaux.fr/gpjswasm/gp-sta.js";)
Uncaught ReferenceError: __dirname is not defined in ES module scope
    at https://pari.math.u-bordeaux.fr/gpjswasm/gp-sta.js:1:761
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async importModuleDynamicallyWrapper (node:internal/vm/module:432:15)
    at async REPL2:1:33



Some hints on the web tell me to use ".mjs" suffix.
While I cannot try that on your website, I will test whether that works on mine ...


Regards,

Hermann.