Skip to content

Support for js module scripts #342

@utay

Description

@utay

It seems like Lightpanda doesn't currently support js module scripts:

fn isJS(stype: ?[]const u8) bool {
if (stype == null or stype.?.len == 0) return true;
if (std.mem.eql(u8, stype.?, "application/javascript")) return true;
if (!std.mem.eql(u8, stype.?, "module")) return true;

I tried to invert this condition but then I got a syntax error at evaluation time so I guess it's here for a good reason:

info(browser): eval remote /assets/index-Bb233Ojc.js: SyntaxError: Cannot use import statement outside a module

I couldn't find an existing issue where this is tracked, curious what needs to be done / what is the blocker for js modules? Let me know if there’s a way I can help!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions