- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2025 04:38 AM
Hi,
I followed below article and created a react project using ServiceNow SDK but when I am trying to build the project using npm run build I am getting error shown in the attached screenshot, do anyone have any idea about why I am getting this error?
C:\SN_DSK> npm run build
> react-ui-page-ts-sample@0.0.1 build
> now-sdk build
[now-sdk] Initiating the build process ...
[now-sdk] Building project from C:\SN_DSK...
[now-sdk] Running script "prebuild" from C:/SN_DSK/now.prebuild.mjs
[now-sdk] ERROR: Build failed: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
Node version : v20.18.0
Npm : 8.19.3
User interface development with React
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2025 10:30 AM
Hi @prasanna-ph looks like you ran into a know bug we have with Windows. The 4.0.1 version should resolve this for you, and we are hoping to publish that today so keep an eye out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2025 05:51 AM
Hi @prasanna-ph,
The error isn’t about your code specifically.It’s coming from how Node handles Windows paths in the ServiceNow SDK build process.
Things to check/try:
- Make sure you’re on the latest @servicenow/sdk.
- Delete node_modules and package-lock.json, then run npm install again.
- The error Received protocol 'c:' usually means an import path is being treated as a URL. Check now.prebuild.mjs (or its dependencies) for absolute paths like C:/.... They need to be formatted as file:///C:/... for Node’s ESM loader.
- If you keep hitting this on native Windows, running the project from WSL (Linux subsystem) avoids the Windows C:/ path issue entirely.
Most people have resolved this either by updating to the latest SDK or by correcting the Windows file path handling.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2025 10:30 AM
Hi @prasanna-ph looks like you ran into a know bug we have with Windows. The 4.0.1 version should resolve this for you, and we are hoping to publish that today so keep an eye out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2025 11:08 PM
Hi @BryceG,
Thank you, Updating to 4.0.1 solved my issue.