Build fails for svelte sample due to rollup-plugin-svelte not loading in SDK 4.2.0 (module is not defined) #29
Unanswered
BoostN
asked this question in
Help and Questions with SDK or Fluent
Replies: 2 comments 2 replies
-
|
Hi @BoostN, Can you install dependencies(cmd/win + shift + p and search for If not, can you try building the app after the dependencies are downloaded |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Appears you are trying to do this from the ServiceNow IDE and getting the error correct? We will try to repro that, see what is going on. I tried this on desktop/cli without any errors at least. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When attempting to build the svelte-ui-page-sample using the ServiceNow SDK, the build fails during the prebuild step with a module loading error.
The failure appears to occur when now.prebuild.mjs attempts to require rollup-plugin-svelte.
[ide] Building Svelte UI Example ... [info] Using SDK 4 runtime loaded from disk at: /d784d194f0f74d0783f07bb902f227a7 [info] Starting build [ svelte-ui-page-sample | x_svelteuisample | 0.0.1 ] [info] @servicenow/sdk version: 4.2.0 [info] Fluent Sources: src/fluent [info] Server Modules: src/server [info] Output: dist/app [info] Running script "prebuild" from /d784d194f0f74d0783f07bb902f227a7/now.prebuild.mjs [ide] [ERROR] Failed to build Svelte UI Example : Could not require /d784d194f0f74d0783f07bb902f227a7/now.prebuild.mjs from https://<instance>.service-now.com/sn_glider_app/virtual-module:/.../node_modules/@servicenow/sdk/dist/web/index.js Could not require rollup-plugin-svelte from https://<instance>.service-now.com/sn_glider_app/virtual-module:/.../now.prebuild.mjs module is not definedThis is my package.json:
{ "name": "svelte-ui-page-sample", "version": "0.0.1", "description": "", "license": "UNLICENSED", "scripts": { "build": "now-sdk build", "deploy": "now-sdk install", "transform": "now-sdk transform", "types": "now-sdk dependencies" }, "devDependencies": { "@servicenow/glide": "27.0.3", "@servicenow/sdk": "5.48.0", "typescript": "5.8.2", "eslint": "8.50.0", "@servicenow/eslint-plugin-sdk-app-plugin": "4.2.0", "@servicenow/isomorphic-rollup": "^1.2.1", "svelte": "5.38.7", "rollup-plugin-svelte": "7.1.6", "@rollup/plugin-node-resolve": "16.0.1", "@rollup/plugin-commonjs": "28.0.1" } }Also, you can just clone the repo around this: https://github.com/ServiceNow/sdk-examples/tree/main/svelte-ui-page-sample and it still fails. I will admit I'm a bit new to this SDK Process so I could be missing something.
Beta Was this translation helpful? Give feedback.
All reactions