Skip to content

Commit 8adca89

Browse files
committed
🔧 Add .js extensions to relative imports in provider and script modules
Extend the ESM compliance fix to include provider and script components that were missing explicit .js file extensions. This completes the module resolution fix for native ESM consumers where Node.js requires explicit extensions for relative imports.
1 parent fcdafa8 commit 8adca89

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/provider/env-provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import { type FC, type PropsWithChildren } from 'react'
44

5-
import { type ProcessEnv } from '../typings/process-env'
6-
import { EnvContext } from './env-context'
5+
import { type ProcessEnv } from '../typings/process-env.js'
6+
import { EnvContext } from './env-context.js'
77

88
/**
99
* Props for the {@link EnvProvider} component.

src/provider/public-env-provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { connection } from 'next/server'
22
import { type FC, type PropsWithChildren } from 'react'
33

4-
import { getPublicEnv } from '../helpers/get-public-env'
5-
import { EnvProvider } from './env-provider'
4+
import { getPublicEnv } from '../helpers/get-public-env.js'
5+
import { EnvProvider } from './env-provider.js'
66

77
/**
88
* Props for the {@link PublicEnvProvider} component.

src/script/env-script.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Script, { type ScriptProps } from 'next/script'
22
import { type FC } from 'react'
33

4-
import { escapeJsonForHtml } from '../helpers/escape-json-for-html'
5-
import { type NonceConfig } from '../typings/nonce'
6-
import { type ProcessEnv } from '../typings/process-env'
7-
import { PUBLIC_ENV_KEY } from './constants'
4+
import { escapeJsonForHtml } from '../helpers/escape-json-for-html.js'
5+
import { type NonceConfig } from '../typings/nonce.js'
6+
import { type ProcessEnv } from '../typings/process-env.js'
7+
import { PUBLIC_ENV_KEY } from './constants.js'
88

99
/**
1010
* Props for the {@link EnvScript} component.

src/script/public-env-script.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { type ScriptProps } from 'next/script'
22
import { connection } from 'next/server'
33
import { type FC } from 'react'
44

5-
import { getPublicEnv } from '../helpers/get-public-env'
6-
import { type NonceConfig } from '../typings/nonce'
7-
import { EnvScript } from './env-script'
5+
import { getPublicEnv } from '../helpers/get-public-env.js'
6+
import { type NonceConfig } from '../typings/nonce.js'
7+
import { EnvScript } from './env-script.js'
88

99
/**
1010
* Props for the {@link PublicEnvScript} component.

0 commit comments

Comments
 (0)