Skip to content

@comark/nuxt: Bad character escape sequence, expected 4 hex characters (Note that you need plugins to import files that are not JavaScript) #227

Open

Description

@abhishek-junghare

Environment

Operating system Windows 11.0.26200
CPU Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 cores)
Node.js version v24.15.0
nuxt/cli version 3.35.2
Package manager pnpm@11.5.0
Nuxt version 4.4.6
Nitro version 2.13.4
Builder vite@7.3.3
Config app, compatibilityDate, css, devtools, icon, modules, nitro, routeRules, site, ssr, ui, vite
Modules @nuxt/ui@4.8.1, @pinia/nuxt@0.11.3, pinia-plugin-persistedstate/nuxt@4.7.1, @nuxtjs/sitemap@8.0.15, @nuxtjs/robots@6.0.9, @comark/nuxt@0.3.1

Comark Version

v0.3.1

Reproduction

D:\Projects\project>npx nuxt generate
┌  Building Nuxt for production...
│
●  Nuxt 4.4.6 (with Nitro 2.13.4, Vite 7.3.3 and Vue 3.5.35)
ℹ No dynamic sources detected. Consider enabling zeroRuntime to reduce server bundle size. See https://nuxtseo.com/sitemap/guides/zero-runtime          @nuxtjs/sitemap 9:37:21 am
ℹ Nuxt Icon server bundle mode is set to local                                                                                                                          9:37:22 am
│
●  Nitro preset: static
✔ Nuxt Icon loaded local collection localIcons with 12 icons                                                                                                            9:37:22 am
ℹ Nuxt Icon client bundle consist of 12 icons with 4.58KB(uncompressed) in size                                                                                         9:37:22 am
ℹ Building client...                                                                                                                                                    9:37:24 am
ℹ vite v7.3.3 building client environment for production...                                                                                                             9:37:24 am

[9:37:24 am]  WARN  [plugin nuxt:module-preload-polyfill] Sourcemap is likely to be incorrect: a plugin (nuxt:module-preload-polyfill) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help


[9:37:24 am]  WARN  [plugin @tailwindcss/vite:generate:build] Sourcemap is likely to be incorrect: a plugin (@tailwindcss/vite:generate:build) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

ℹ ✓ 169 modules transformed.                                                                                                                                            9:37:25 am

 ERROR  ✗ Build failed in 879ms                                                                                                                                          9:37:25 am

│
■  Nuxt build error: RollupError: node_modules/.pnpm/@nuxt+ui@4.8.1_@internation_ade17b7dcbc8b72ab9985a79d5266c9b/node_modules/@nuxt/ui/dist/runtime/components/prose/Callout.vue (2:167): Bad character escape sequence, expected 4 hex characters (Note that you need plugins to import files that are not JavaScript)
│  file: D:/Projects/project/node_modules/.pnpm/@nuxt+ui@4.8.1_@internation_ade17b7dcbc8b72ab9985a79d5266c9b/node_modules/@nuxt/ui/dist/runtime/components/prose/Callout.vue:2:167
│  
│  1: <script>
│  2: import theme from "#build/ui/prose/callout";
│                                                 ^
│  3: </script>
│  

Description

Additional context

No response

Logs

Activity

  1. abhishek-junghare commented on Jun 2, 2026

    @abhishek-junghare
    Author

    #191 (comment) - I tried this, but didn't help.

  2. farnabaz commented on Jun 10, 2026

    @farnabaz
    Collaborator

    Hey @abhishek-junghare
    Do you mind providing a simple repo so I can clone and reproduce the issue?

  3. caybokotze commented on Jun 10, 2026

    @caybokotze

    This is fixed by #207, released in @comark/vue@0.4.0 — but @comark/nuxt@^0.3.1 resolves its @comark/vue dependency to 0.3.1, which predates the fix, so a regular lockfile update never picks it up. Upgrading explicitly resolves the build error:

    pnpm add @comark/nuxt@^0.4.0
    

    Confirmed on Windows 11, Nuxt 4.4.6, @nuxt/ui 4.8.2: same Bad character escape sequence error in prose/Callout.vue / prose/Badge.vue on 0.3.1, clean production build after upgrading to 0.4.0 (no other changes).

    For context, the failure mechanism: the viteComarkSlot node transform injects runtimeDir as an import path into compiled Vue template code for any component containing <slot mdc-unwrap> (which is exactly @nuxt/ui's prose components). On Windows that path contains backslashes, so segments like \utils / \node_modules become \u... / \n escape sequences in the generated import specifier, which Rollup rejects during the client production build. Dev mode tolerates it, which is why it only shows up in nuxt build. 0.4.0 normalizes the injected path via toImportPath().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions