Comments (5)
I tried removing as const satisfies MyType
and I'm still getting this failure. Other files seem fine, but I'm not sure what is unique about this one.
from esm.sh.
OK it looks like this package (js_parser) is being invoked here:
https://github.com/esm-dev/esm.sh/blob/main/server/utils.go#L205
It looks like that only validates JavaScript files using this:
https://github.com/ije/esbuild-internal/blob/master/js_parser/js_parser.go
Although, it seems to allow TypeScript files to be "found" and passed in. Writing a small test, I think this is the root cause:
--- FAIL: TestStrictMode (0.00s)
--- FAIL: TestStrictMode/import{A,B}from"C";export_const_D={}_as_const_satisfies_A;export_default_B(D); (0.00s)
js_parser_test.go:286:
+<stdin>: ERROR: Expected ";" but found "as"
The util should probably make use of the ts_parser if one of the ts extensions is selected:
https://github.com/ije/esbuild-internal/blob/master/js_parser/ts_parser.go
This was a confusing error because the message states require either javascript OR typescript, so it made me assume both were valid here. Upon inspection, I believe TS isn't properly supported.
Wishing I could see the actual <stdin>
errors that are being produced in situ to confirm further.
from esm.sh.
Confirmed locally that enabling TS parsing allows these files to be properly served via esm.sh.
from esm.sh.
i just pushed docker image to v135_2 with your patch, thanks for contributing
from esm.sh.
Please release this fix, as 135 still fails, for example:
https://esm.sh/v135/@rhds/[email protected]/es2022/lib/context/color/context-color.css.js
/* esm.sh - error */
throw new Error("[esm.sh] " + "esmLexer: invalid syntax, require javascript/typescript");
export default null;
and https://esm.sh/v135_2/@rhds/[email protected]/es2022/lib/context/color/context-color.css.js 404s
Thank you for making this helpful service available.
from esm.sh.
Related Issues (20)
- Support GitHub Gists
- Failed to import - d3 HOT 1
- Failed init cli on NPM HOT 7
- Support importing modules from jsr.io HOT 1
- how to get react profiling version
- Failed to import - basehub/react - shows 500 Internal Server Error. - on commit
- Failed to import - @mui/material HOT 6
- Failed to import - openlayers
- All previously built urls are failing HOT 1
- Question: why don't you use yarn pnp
- Self hosted - 405 Response using the npm.pkg.github.com registry HOT 3
- Wrong `x-typescript-types` for `@babel/parser`
- Failed to import - @headlessui/react HOT 3
- Failed to import - [email protected] (previous version works) HOT 3
- Problem with using Monaco with ESM HOT 2
- Failed to import - Cloudscape components
- Failed to set `react` as external dependency
- Failed to set `@use-gesture/core/action` as external dependency HOT 2
- Failed to import - jotai/utils
- Invalid hook call with @react-three/fiber HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esm.sh.