jspm / generator

JSPM Import Map Generator
Apache License 2.0
166 stars 21 forks source link

error in parsing import assertions. #127

Closed fusionstrings closed 2 years ago

fusionstrings commented 2 years ago

Parsing import assertion throws.

Following is a reproduction of the issue. The example uses chomp but since the issue originates from babel parser, probably it's caused by generator.

https://github.com/fusionstrings/jspm-generator-json-import-error

guybedford commented 2 years ago

The repo seems to be not found, it would be useful to see the reproduction to fix the issue.

fusionstrings commented 2 years ago

The repo seems to be not found, it would be useful to see the reproduction to fix the issue.

I accidentally made the repo private. Made it public now.

The code similar to below is throwing due to parsing error.

import {
  contentType,
  lookup,
} from "https://deno.land/x/media_types@v3.0.2/mod.ts";
import json from "./static-resources.json" assert { type: "json" };

Object.values(json).forEach((value) => {
  console.log(contentType(lookup(value)));
});