#library used in script tag not being transpiled

1 messages · Page 1 of 1 (latest)

steel monolith
#

Hello.
I got the impression from reading the docs that you can use any npm library within script tags by just importing it, and that it will be bundled with the page that requires it.
I did it, and works perfectly in development, but once deployed to vercel, the code is not executed (is basically confetti). Any way I can debug this ? Really wish is not another problem with the Vercel adapter

#

Ok, for some reason the code is NOT being transpiled:

]Uncaught SyntaxError: Cannot use import statement outside a module (at confirm-yes:7:3)
#

library used in script tag not being transpiled

rich peak
steel monolith
#

The problem was similar, indeed

#

I thought that, in order to use typescript I had to add lang="ts"

#

Removing all attributes fixed the problem

#

Thanks

rich peak
#

No problem!