`import.meta` causes issues
See original GitHub issueThe latest versions of mathlive include the import.meta
-syntax in its output *.mjs
-file. There’s a couple of issues with that:
- I am not sure that’s supposed to end up in the compilation result. AFAIU the
import.meta.url
should point to the location of the single module where it’s included (src/core/fonts.ts
). By including it into the compilation-result, it will point tomathlive.mjs
(and to wherever that is located as a dependency relative to the using application). - The syntax is not well supported by babel yet and therefore the using application fails to compile then. There are plugins for babel to support it, but those cannot easily be used if tools like create-react-app are used.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:24 (22 by maintainers)
Top Results From Across the Web
ESlint - import.meta causes Fatal Parsing Error - Stack Overflow
@Bergi : I think you've discovered my issue. I'm setting the parser with eslint.parserOptions.parser = 'babel-eslint' . However, I should be ...
Read more >import.meta.resolve() - Chrome Platform Status
import.meta.resolve(specifier) returns the URL to which the given specifier would resolve in the context of the current script.
Read more >import.meta - JavaScript - MDN Web Docs
The import.meta meta-property exposes context-specific metadata to a JavaScript module. It contains information about the module, ...
Read more >rollup.js
Importing CommonJS · Publishing ES Modules ... This is not a problem caused by Rollup putting the import at the top of the...
Read more >Content Types - ESBuild
import.meta, es2020, import.meta ... It only causes compatibility problems for CommonJS modules that used to be ES modules (i.e. when __esModule is present) ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
mathlive@0.55.0 no longer uses import.meta.
Some more detailed instructions on how to integrate mathlive with Webpack can be found here http://cortexjs.io/guides/mathfield-getting-started/
Note that the default name of the distribution library has changed from “mathlive.js” and “mathlive.mjs” to “mathlive.min.js” and “mathlive.min.mjs”
I have some ideas on how to address this. I need to do some more testing, but I’ll give an update soon.