8000 latest @sentry/nuxt throw error at build time · Issue #16122 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

latest @sentry/nuxt throw error at build time #16122

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

Closed
3 tasks done
rtabulov opened this issue Apr 24, 2025 · 9 comments
Closed
3 tasks done

latest @sentry/nuxt throw error at build time #16122

rtabulov opened this issue Apr 24, 2025 · 9 comments
Assignees
Labels
Bug External Dependency To close this issue, an external dependency needs to be adjusted/fixed Nuxt

Comments

@rtabulov
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nuxt

SDK Version

9.14.0

Framework Version

nuxt@3.16.2

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

freshly installed @sentry/nuxt via sentry wizard.

Expected Result

expected to build without errors

issue seems similar to #14980 , but im not using svelte so im unable to fix with the suggested method

Actual Result

command nuxt build exits with error

# ...bunch of source map logs
[sentry-vite-plugin] Info: Successfully uploaded source maps to Sentry
ℹ ✓ built in 12.13s                                                                                                                                                       10:25:42 AM
✔ Server built in 12181ms                                                                                                                                                 10:25:42 AM
✔ Generated public .output/public                                                                                                                                   nitro 10:25:40 AM
ℹ Building Nuxt Nitro server (preset: node-server, compatibility date: 2024-11-01)                                                                                  nitro 10:25:41 AM

[nitro 10:26:06 AM]  ERROR  TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received 'REDACTED/i18n/locales/\x00sentry-release-injection-file'


undefined


 ERROR  The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received 'REDACTED/i18n/locales/\x00sentry-release-injection-file'           10:26:06 AM

    at statSync (node:fs:1665:10)
    at resolveModuleURL (node_modules/exsolve/dist/index.mjs:1247:11)
    at resolveModulePath (node_modules/exsolve/dist/index.mjs:1306:20)
    at _resolvePathGranularly (node_modules/@nuxt/kit/dist/index.mjs:2437:30)
    at async resolvePath (node_modules/@nuxt/kit/dist/index.mjs:2328:15)
    at async Object.transform (node_modules/@nuxtjs/i18n/dist/module.mjs:1098:25)
    at async transform (node_modules/rollup/dist/es/shared/node-entry.js:20906:16)
    at async ModuleLoader.addModuleSource (node_modules/rollup/dist/es/shared/node-entry.js:21119:36) 



 ERROR  The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received 'REDACTED/i18n/locales/\x00sentry-release-injection-file'           10:26:06 AM

error: script "build" exited with code 1
@s1gr1d
Copy link
Member
s1gr1d commented Apr 25, 2025

Hello, thanks for writing in. Can you share some information about the OS you are using? There seems to be an issue with the slashes in the path (/\)

@s1gr1d s1gr1d self-assigned this Apr 25, 2025
@getsantry getsantry bot moved this from Waiting for: Product Owner to Waiting for: Community in GitHub Issues with 👀 3 Apr 25, 2025
@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 May 12, 2025
@dargmuesli
Copy link

@rtabulov which version of nuxt-i18n are you using?

@dargmuesli
Copy link

I have the same issue, but for me it started to appear with the latest nuxt-i18n beta only which has been released a few days ago. So I opened an issue in the i18n repo: nuxt-modules/i18n#3595

Let's see what the root cause is, I'm not sure.

@s1gr1d
Copy link
Member
s1gr1d commented May 13, 2025

Hello, I will take a look at this as well as Sentry adds a null byte (\0 as seen in the path) as a prefix. In general, this should not cause problems as this is a common Rollup convention (see https://rollupjs.org/plugin-development/#conventions).

@s1gr1d
Copy link
Member
s1gr1d commented May 13, 2025

I attempted to reproduce this by installing the @nuxtjs/i18n module with the latest v9 and v10 alongside Sentry. But I am not able to reproduce this issue - the build runs through smoothly.

Would you be able to provide a small reproduction of this?

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 May 13, 2025
@andreypopov
Copy link
andreypopov commented May 13, 2025

I have exactly the same issue. Happened after update to "@nuxtjs/i18n": "10.0.0-beta.4"

It works without sentry OR without i18n.config.ts

@s1gr1d maybe try to use i18n.config.ts to reproduce it and run "nuxt build"

nuxt.config :

i18n: {
        detectBrowserLanguage: {
            cookieSecure: true
        },
        vueI18n: '~/utils/i18n.config.ts',
        customRoutes: 'config',
        bundle: {
            optimizeTranslationDirective: false,
        },
    },

i18n.config.ts

export default defineNuxtConfig({
    return {
        legacy: false,
        globalInjection: true,
        strategy: 'prefix',
        detectBrowserLanguage: false,
    };
});

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 May 13, 2025
@s1gr1d
Copy link
Member
s1gr1d commented May 14, 2025

I created a reproduction for this issue now: https://github.com/s1gr1d/reprex.sentry-javascript-16122_nuxt-sentry-i18n

Seems like the i18n.config.ts file creates this problem. I will post this reproduction in the i18n repository. It's something to fix on their end.


I modified the snippet a bit to be aligned with the i18n docs. It's defineI18nConfig in the docs and it's getting a function as an argument. Your provided snippet throws a linting error.

export default defineI18nConfig(() => {
    return {};
});

@s1gr1d s1gr1d added the External Dependency To close this issue, an external dependency needs to be adjusted/fixed label May 14, 2025
@s1gr1d
Copy link
Member
s1gr1d commented May 14, 2025

Closing this as I added a comment with some explanation in the i18n repository: nuxt-modules/i18n#3595 (comment)

If it turns out to be a Sentry issue, we will reopen this issue.

@s1gr1d s1gr1d closed this as completed May 14, 2025
@s1gr1d
Copy link
Member
s1gr1d commented May 16, 2025

For context - this is the PR in i18n fixing this issue: nuxt-modules/i18n#3603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug External Dependency To close this issue, an external dependency needs to be adjusted/fixed Nuxt
Projects
Archived in project
Development

No branches or pull requests

4 participants
0