-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
SimpleModuleLoader
cannot resolve relative paths on the CLI
#4085
Comments
This is what I did to replicate:
I immediately get the |
The cli will treat input files as scripts by default. To treat the files as modules, you need to use the boa play.js -m |
@jedel1043 Thanks for that. Getting this different error now:
The line in question is:
Tried searching this repo and google, but can't find anyone else experiencing this. Any suggestions? |
It is possible that the module resolver didn't use the correct root path to resolve the modules, so you can pass it explicitly with the boa play.js -m --root some/root/dir If that still doesn't work, we can reopen this to track that bug. |
@jedel1043 No luck using root, either with
|
Reopening this to look at the issue. |
import
/ export
SimpleModuleLoader
cannot resolve relative paths on the CLI
Opened #4108 to fix the import error. However, note that after the fix the code is throwing |
@jedel1043 The use of |
Yeah, no support for setting environment variables. Also I'm seeing that it also uses the We haven't added much things to the example runtime because developing a whole runtime is itself a lot of work that is separate from the development of the engine, so we depend on contributions for adding new features to it. |
Understood. I'll circle back to Boa later in the year to see if a few of these things are available then. Unfortunately, I'm not proficient enough with Rust to help contribute in any meaningful way sorry. |
Describe the bug
Trying to run this code using Boa: https://github.com/KieranP/Game-Of-Life-Implementations/tree/master/typescript
import { World } from './world.js';
producing this error:Uncaught SyntaxError: expected token '.', got '{' in import.meta at line 1, col 8
export class World {
producing this error:Uncaught SyntaxError: unexpected token 'export', primary expression at line 3, col 1
To Reproduce
Compile the Typescript to Javascript using
tsc
and then try to runboa play.js
Expected behavior
Should parse and run as expected. The code doesn't contain anything complex
Build environment (please complete the following information):
The text was updated successfully, but these errors were encountered: