Unexpected token 'export' (deno_core)
Playing around with ModuleLoaders, but doesn't seem to make a difference
Scripts containing the export keyword don't load due to above error
How can I allow the keyword?
6 Replies
execute_script
only parses/runs scripts, not modules
much like <script>
in HTML, rather than <script type="module">
you have to use load_main_module
and evaluate_mod
and so on together with a module loaderIs there a non asynchronous version of load_main_module?
no
since modules can have top-level await
Ok last question... Switched to using global.functionName instead of modules, but the global keyword doesn't work either.
globalThis does work, strangely
global
is just part of the Node.js API, it's not a JS built-in
deno_core doesn't have window
either
you can add it by executing the script globalThis.global = globalThis;
or by having that as part of an extensionRight
Fair enough. Thanks!