Skip to content

WorkerNavigator is not defined #81

@richard-thai

Description

@richard-thai

Hi

I'm encountering an error "WorkerNavigator is not defined" while testing @azure/app-configuration-provider on a NextJS 14 project using App Router.

Any assistance would be appreciated. Thank you.

stacktrace

ReferenceError: WorkerNavigator is not defined
    at **isWebWorker** (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/requestTracing/utils.js:97:137)
    at getHostType (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/requestTracing/utils.js:74:14)
    at createCorrelationContextHeader (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/requestTracing/utils.js:20:72)
    at #loadSelectedKeyValues (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/AzureAppConfigurationImpl.js:129:197)
    at #loadSelectedAndWatchedKeyValues (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/AzureAppConfigurationImpl.js:169:65)
    at AzureAppConfigurationImpl.load (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/AzureAppConfigurationImpl.js:185:52)
    at load (webpack-internal:///(rsc)/../../node_modules/.pnpm/@azure+app-configuration-provider@1.0.0/node_modules/@azure/app-configuration-provider/dist-esm/load.js:53:32)
    at eval (webpack-internal:///(rsc)/../../packages/core/src/config/app-configuration.ts:21:96)
    at __webpack_require__.a (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\apps\webui\.next\server\webpack-runtime.js:105:13)
    at eval (webpack-internal:///(rsc)/../../packages/core/src/config/app-configuration.ts:1:21)
    at (rsc)/../../packages/core/src/config/app-configuration.ts (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\apps\webui\.next\server\app\(workflow)\admin\page.js:719:1)
    at __webpack_require__ (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\apps\webui\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./app/(workflow)/admin/page.tsx:8:96)
    at __webpack_require__.a (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\apps\webui\.next\server\webpack-runtime.js:105:13)
    at eval (webpack-internal:///(rsc)/./app/(workflow)/admin/page.tsx:1:21)
    at (rsc)/./app/(workflow)/admin/page.tsx (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\apps\webui\.next\server\app\(workflow)\admin\page.js:577:1)
    at Function.__webpack_require__ (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\apps\webui\.next\server\webpack-runtime.js:33:43)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)
    at async e7 (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:39
6786)
    at async rU (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:72
90)
    at async C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:10360
    at async Promise.all (index 0)
    at async rU (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:10
036)
    at async C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:10360
    at async Promise.all (index 0)
    at async rU (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:10
036)
    at async C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:10360
    at async Promise.all (index 0)
    at async rU (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:10
036)
    at async r1 (C:\Projects\Framework\ui\template\nextjs\internal-webapp-basic\node_modules\.pnpm\next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:17
308)

config.tsx

import { config } from "@example/core/config/app-configuration";

export default function Config() {

    return (
        <>
            <h1>Config</h1>
            <p>{JSON.stringify(config)}</p>
        </>
    );
}

app-configuration.ts

import { load } from '@azure/app-configuration-provider';

const connectionString = process.env.APPCONFIG_CONNECTION_STRING!;
const keyPrefix = process.env.APPCONFIG_KEY_PREFIX!;

const appConfig = await load(connectionString, {
    selectors: [
        {
            keyFilter: `${keyPrefix}.*`,
        },
    ],
    trimKeyPrefixes: [keyPrefix],
});

export const config = appConfig.constructConfigurationObject({
    separator: "."
});

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy