-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking βSign up for GitHubβ, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: JSON import type assertion #1824
Conversation
β Deploy Preview for nuxt-content ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
WARN rollup-plugin-inject: failed to parse /node_modules/@nuxt/content/dist/runtime/transformers/shiki/highlighter.mjs. Consider restricting the plugin to particular files via options.include
ERROR
2: import consola from "consola";
3: import { createSingleton } from "../utils.mjs";
4: import mdcTMLanguage from "./languages/mdc.tmLanguage.json" assert { type: "json" };
^
5: const logger = consola.withScope("@nuxt/content");
6: const resolveLang = (lang) => BUNDLED_LANGUAGES.find((l) => l.id === lang || l.aliases?.includes(lang))?.id || lang; Do you get this error? |
That error shows up but oddly enough the pages are still built locally. This patch was the obvious one to resolve the esbuild issue. There is a bypass without patching the library: change the -import { defineTransformer } from '@nuxt/content/transformers'
+import { defineTransformer } from '@nuxt/content/transformers/utils' |
Thanks for the workaround. |
Import assertion is only supported in Node.js 17 or later (ref). And most of the users still use v16. |
Let's convert the json file into a JavaScript one. This will resolve the issue. @pi0 WDYT? |
That approach is better. Patch updated. There were type issues which prevented the use of the official {
"repository": {
"block": {
"comment": "Same as `text.html.markdown#block`, but without `raw_block`", Based on its usage:
Neither |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
π Linked issue
#1823
β Type of change
π Description
See linked issue
π Checklist