- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
I've been trying to assemble a front-end using the new 4.0.x version of the ServiceNow SDK and I have a consistent error with the commonjs--resolver plugin during the build process.
I am building on Ubuntu via WSL using @Servicenow/sdk@4.0.2, with Windows 10 as the underlying operating system. An image of my package.json is attached to avoid an overly long message here.
The packages relevant to this issue are @Mui/x-charts, and react-plotly.js, both with different issues.
With the @Mui/x-charts package, I receive the following error when building using the now-sdk build command:
Error: ENOENT: no such file or directory, lstat '/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/d3-scale/node_modules/d3-format'
at Object.realpathSync (node:fs:2787:29)
at /mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:29208:29
at new Promise (<anonymous>)
at RollupFsAdapter.realpath (/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:29206:16)
at /mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:5552:6
at maybeRealpath (/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:2087:9)
at loadAsDirectory (/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:2291:9)
at onfile (/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:2352:13)
at load (/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:2225:43)
at onex (/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/@servicenow/isomorphic-rollup/dist/index.js:2250:17) {
errno: -2,
code: 'PLUGIN_ERROR',
syscall: 'lstat',
path: '/mnt/c/Users/fang2/OneDrive/Documents/ServiceNow/SDK Projects/Pet Registry (Example App)/node_modules/d3-scale/node_modules/d3-format',
pluginCode: 'ENOENT',
plugin: 'commonjs--resolver',
hook: 'resolveId',
I have had consistent issues with the common-js resolver, and this is the latest. I regret not hanging on to the other failures.
When attempting to build with the react-plotly.js package, the Rollup build processes simply received a signal to terminate, or earlier a signal to kill while partway through the process.
While trying to find a solution, I've attempted to add new Rollup plugins to the build process in varying orders with no success. I'll likely try to alias this latest error but every time I fix one error another appears.
I got feedback while messing with the plugin order that the node-resolver version that was used in the isomorphic rollup process was v1.0.0, and I suspect that may be causing issues in the resolution of paths in some complex packages.
Oddly, when building on Windows, I have no errors during build, but am unable to reach the ./main.tsx file from the index.html root document on the UI Page. This error resolves when the pie chart is removed from the tsx. This error occurs with an example taken directly from the MUI documentation, no props needed.
The addition of plotly-react on Windows still causes an OOM error even with 4GB of heap memory during the build process.
If anybody has found any workarounds for using these packages, or encountered similar difficulties and figured out a solution I would appreciate a nudge in the right direction!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
hello! this is a bug with our isomorphic-rollup package. we will be fixing this in the next patch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
hello! this is a bug with our isomorphic-rollup package. we will be fixing this in the next patch.