pluvial / svelte-adapter-deno

A SvelteKit adapter for Deno
https://svelte-adapter-deno.deno.dev/
MIT License
313 stars 14 forks source link

Example deno run command not working #12

Closed tiloio closed 2 years ago

tiloio commented 2 years ago

The command deno run --allow-env --allow-read --allow-net path/to/build/server.js in the readme.md is currently not working.

You will get this error:

TS2497 [ERROR]: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.
export { default as ms } from "https://cdn.skypack.dev/ms@2.1.2?dts";

This issue https://github.com/asos-craigmorten/opine/issues/146 is describing the problem.

You need to have a tsconfig.json file with the following content:

{
    "compilerOptions": {
        "allowSyntheticDefaultImports": true
    }
}

And add the --config ./tsconfig.json to the command.

deno run --allow-env --allow-read --allow-net --config ./tsconfig.json path/to/build/server.js.

jpaquim commented 2 years ago

Hey @tiloio thank you for reporting here and upstream, and for pointing out the solution! I'll make the correction, and test if everything is running correctly.