#vite build failed

7 messages · Page 1 of 1 (latest)

twin dirge
#

npm run dev, works just fine but vite fails at build time.

gitpod /workspace/namepedia (main) $ npm run build

build
astro build

04:57:48 [build] output: "static"
04:57:48 [build] directory: /workspace/namepedia/.vercel/output/static/
04:57:48 [build] adapter: <@&1055234544183287879>/vercel/static
04:57:48 [build] Collecting build info...
04:57:48 [build] ✓ Completed in 86ms.
04:57:48 [build] Building static entrypoints...
04:57:52 [vite] ✓ built in 4.39s
04:57:52 [build] ✓ Completed in 4.43s.

building client (vite)
04:57:52 [vite] ✓ 0 modules transformed.
04:57:52 [ERROR] [vite] x Build failed in 7ms
transforming (64) node_modules/react-dom/client.js[astro:build] The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '/workspace/namepedia/\x00astro-entry:/workspace/namepedia/src/components/tsconfig.json'
file: astro-entry:/workspace/namepedia/src/components/Header.astro
Stack trace:
at Object.stat (node:fs:1588:10)
at find (file:///workspace/namepedia/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:13765:2)
at async loadTsconfigJsonForFile (file:///workspace/namepedia/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:14857:24)
at async compileAstro (file:///workspace/namepedia/node_modules/astro/dist/vite-plugin-astro/compile.js:14:21)

humble wadiBOT
#

Hi @twin dirge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, it seems like you're encountering a build error with Astro and Vite. The error message suggests that the 'path' argument must be a string, Uint8Array, or URL without null bytes.

Unfortunately, the extracts do not provide a direct solution to this specific issue. However, there are a few things you could try:

  1. Ensure that your project's file paths do not contain any null bytes or unusual characters. The error message suggests that there might be an issue with the path to your tsconfig.json file.

  2. Check your Astro and Vite configurations. Some of the extracts mention issues that were resolved by adjusting the configuration settings. For example, in this issue (https://github.com/withastro/astro/issues/2776), the user was able to resolve a similar problem by adjusting the assetsDir setting in their Vite configuration.

  3. Update your dependencies. Some of the extracts mention issues that were resolved by updating to the latest versions of Astro and Vite.

If none of these suggestions help, I recommend checking the Astro GitHub issues (https://github.com/withastro/astro/issues) for similar problems or opening a new issue to get help from the Astro community.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@twin dirge kapa.ai is still learning and improving, please let us know how it did by reacting below

twin dirge
#

@humble wadi the issue seems to be in this line: \x00astro-entry

transforming (64) node_modules/react-dom/client.js[astro:build] The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '/workspace/namepedia/\x00astro-entry:/workspace/namepedia/src/components/tsconfig.json'

The project is adding random stuff into the path how can i fix this

humble wadiBOT
#

Let me check the knowledge base for you. One moment! :books:

#

Based on the extracts provided, it seems that Astro has had issues with certain characters and spaces in file paths. This could potentially be the cause of the \x00astro-entry being added to your path.

Here are a few things you could try:

  1. Check your project's file paths: Ensure there are no unusual characters or spaces in your project's file paths. In this issue (https://github.com/withastro/astro/issues/4636), a user reported a problem with a space in the path, and in this issue (https://github.com/withastro/astro/issues/4689), a user reported a problem with non-English characters in the path.

  2. Update Astro: Some of the issues were resolved in later versions of Astro. Make sure you're using the latest version of Astro.

  3. Check your Astro configuration: In this issue (https://github.com/withastro/astro/issues/2205), a user reported a problem with the projectRoot setting in their Astro configuration. Check your astro.config.mjs file to make sure the projectRoot setting is correct.

If none of these suggestions help, I recommend opening a new issue on the Astro GitHub (https://github.com/withastro/astro/issues) to get help from the Astro community.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: