
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 08:15 AM
I recently encountered this issue when I tried to use a type from sdk/core in a TypeScript file in the server directory.
I had taken the existing file `/src/fluent/server/script.ts` and added an import from @Servicenow/sdk/core and all of a sudden now-sdk builds started failing, starting with the following errors.
node_modules/@servicenow/sdk-core/src/db/Table.ts:4:31 - error TS2503: Cannot find namespace 'Now'.
export type TableName = keyof Now.Internal.Tables
We're used to using the core libraries in Fluent (e.g. Record or BusinessRule) but in order to do so you must make sure that the first line of the file imports the @Servicenow/sdk/global library before importing sdk/core, like this:
import '@servicenow/sdk/global' // Don't forget this
import { GlideRecord } from '@servicenow/sdk/core' // If you're going to add this
import { gs } from '@servicenow/glide'
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 08:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 08:16 AM