Deployment fails with error Cannot find module 'node:fs'

I have deployed a simple static vue3 site on render which has been running fine so far. Made some small changes by adding an image and changing its variable file path and pushed the changes to Github. The auto deployment system in Render tried to build and deploy the site but failed. Unsure what is causing the issues. It gave me the following error messages

Here are the logs:

info==> Cloning from
info==> Checking out commit 906cc0702554b5bff85032af519b59894d1cd8c9 in branch main
info==> Downloading cache...
info==> Transferred 288MB in 10s. Extraction took 4s.
info==> Using Node version 14.17.0 (default)
info==> Docs on specifying a Node version:
info==> Using Ruby version 3.2.2 (default)
info==> Docs on specifying a Ruby version:
info==> Installing dependencies with npm...
infoaudited 206 packages in 1.971s
info37 packages are looking for funding
info run `npm fund` for details
infofound 0 vulnerabilities
infoaudited 206 packages in 3.582s
info37 packages are looking for funding
info run `npm fund` for details
infofound 0 vulnerabilities
info==> Using Python version 3.7.10 (default)
info==> Docs on specifying a Python version:
info==> Using Poetry version 1.1.14 (default)
info==> Docs on specifying a Poetry version:
info==> Installing Poetry version 1.1.14
infoRetrieving Poetry metadata
info# Welcome to Poetry!
infoThis will download and install the latest version of Poetry,
infoa dependency and package manager for Python.
infoIt will add the `poetry` command to Poetry's bin directory, located at:
infoYou can uninstall at any time by executing this script with the --uninstall option,
infoand these changes will be reverted.
infoInstalling Poetry (1.1.14)
infoInstalling Poetry (1.1.14): Creating environment
infoInstalling Poetry (1.1.14): Installing Poetry
infoInstalling Poetry (1.1.14): Creating script
infoInstalling Poetry (1.1.14): Done
infoPoetry (1.1.14) is installed now. Great!
infoTo get started you need Poetry's bin directory (/opt/render/project/poetry/bin) in your `PATH`
infoenvironment variable.
infoAdd `export PATH="/opt/render/project/poetry/bin:$PATH"` to your shell configuration file.
infoAlternatively, you can call Poetry explicitly with `/opt/render/project/poetry/bin/poetry`.
infoYou can test that everything is set up by executing:
info`poetry --version`
info==> Running build command 'yarn build'...
infoyarn run v1.22.21
info$ vite build
infofailed to load config from /opt/render/project/src/vite.config.js
errorerror during build:
errorError: Cannot find module 'node:fs'
infoRequire stack:
info- /opt/render/project/src/node_modules/@vitejs/plugin-vue/dist/index.cjs
info- /opt/render/project/src/vite.config.js
info- /opt/render/project/src/node_modules/vite/dist/node/chunks/dep-68d1a114.js
info at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
info at Function.Module._load (internal/modules/cjs/loader.js:730:27)
info at Module.require (internal/modules/cjs/loader.js:957:19)
info at require (internal/modules/cjs/helpers.js:88:18)
info at Object.<anonymous> (/opt/render/project/src/node_modules/@vitejs/plugin-vue/dist/index.cjs:5:12)
info at Module._compile (internal/modules/cjs/loader.js:1068:30)
info at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
info at Object._require.extensions.<computed> [as .js] (file:///opt/render/project/src/node_modules/vite/dist/node/chunks/dep-68d1a114.js:66350:17)
info at Module.load (internal/modules/cjs/loader.js:933:32)
info at Function.Module._load (internal/modules/cjs/loader.js:774:14)
errorerror Command failed with exit code 1.
infoinfo Visit for documentation about this command.
info==> Build failed 😞

node:fs only existed as of Node 16, a dependency in your application requires Node 16 but your app is using an older version, presumably 14.17.0 which Render defaulted to until recently.

See Setting Your Node.js Version | Render Docs

Oh dude,
thanks a ton.
that solved it.
I am putting the link here for the documentation in case someone else faces a similar issue in the future

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.