<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question error TS2503: Cannot find namespace 'Now'. in ServiceNow IDE, SDK, and Fluent forum</title>
    <link>https://www.servicenow.com/community/servicenow-ide-sdk-and-fluent/error-ts2503-cannot-find-namespace-now/m-p/3103661#M78</link>
    <description>&lt;P&gt;I recently encountered this issue when I tried to use a type from sdk/core in a TypeScript file in the server directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had taken the existing file `/src/fluent/server/script.ts` and added an import from&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5544"&gt;@Servicenow_1&lt;/a&gt;/sdk/core and all of a sudden now-sdk builds started failing, starting with the following errors.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;node_modules/@servicenow/sdk-core/src/db/Table.ts:4:31 - error TS2503: Cannot find namespace 'Now'.
export type TableName = keyof Now.Internal.Tables&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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 &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5544"&gt;@Servicenow_1&lt;/a&gt;/sdk/global library before importing sdk/core, like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;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'
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 16:15:57 GMT</pubDate>
    <dc:creator>Jon G Lind</dc:creator>
    <dc:date>2024-11-13T16:15:57Z</dc:date>
    <item>
      <title>error TS2503: Cannot find namespace 'Now'.</title>
      <link>https://www.servicenow.com/community/servicenow-ide-sdk-and-fluent/error-ts2503-cannot-find-namespace-now/m-p/3103661#M78</link>
      <description>&lt;P&gt;I recently encountered this issue when I tried to use a type from sdk/core in a TypeScript file in the server directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had taken the existing file `/src/fluent/server/script.ts` and added an import from&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5544"&gt;@Servicenow_1&lt;/a&gt;/sdk/core and all of a sudden now-sdk builds started failing, starting with the following errors.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;node_modules/@servicenow/sdk-core/src/db/Table.ts:4:31 - error TS2503: Cannot find namespace 'Now'.
export type TableName = keyof Now.Internal.Tables&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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 &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5544"&gt;@Servicenow_1&lt;/a&gt;/sdk/global library before importing sdk/core, like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;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'
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 16:15:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ide-sdk-and-fluent/error-ts2503-cannot-find-namespace-now/m-p/3103661#M78</guid>
      <dc:creator>Jon G Lind</dc:creator>
      <dc:date>2024-11-13T16:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: error TS2503: Cannot find namespace 'Now'.</title>
      <link>https://www.servicenow.com/community/servicenow-ide-sdk-and-fluent/error-ts2503-cannot-find-namespace-now/m-p/3103663#M79</link>
      <description>&lt;P&gt;Added import of&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5544"&gt;@Servicenow_1&lt;/a&gt;/sdk/global to fix it.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 16:16:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ide-sdk-and-fluent/error-ts2503-cannot-find-namespace-now/m-p/3103663#M79</guid>
      <dc:creator>Jon G Lind</dc:creator>
      <dc:date>2024-11-13T16:16:59Z</dc:date>
    </item>
  </channel>
</rss>

