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

Issues with import / export #4085

Open
KieranP opened this issue Dec 12, 2024 · 2 comments
Open

Issues with import / export #4085

KieranP opened this issue Dec 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@KieranP
Copy link

KieranP commented Dec 12, 2024

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 run boa play.js

Expected behavior

Should parse and run as expected. The code doesn't contain anything complex

Build environment (please complete the following information):

  • OS: Mac OS
  • Version: Sequioa 15.1.1
  • Target triple: arm64
  • Rustc version: 1.83.0
@KieranP KieranP added the bug Something isn't working label Dec 12, 2024
@KieranP
Copy link
Author

KieranP commented Dec 12, 2024

This is what I did to replicate:

brew install typescript
cargo install boa_cli
PATH=~/.cargo/bin:$PATH
git clone https://github.com/KieranP/Game-Of-Life-Implementations.git
cd Game-Of-Life-Implementations/typescript
tsc
boa play.js

I immediately get the Uncaught SyntaxError: expected token '.', got '{' in import.meta at line 1, col 8 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@KieranP and others