Skip to content

firefox: Uncaught (in promise) ReferenceError: URLPattern is not defined #34

@jbpratt

Description

@jbpratt

testgrid doesn't load on FF due to the below error. urlpattern-polyfill should resolve this but the latest version causes type issues in the build (see below) though I don't think we should even have to install it ourselves (lit/lit#2831)

browser logs
Uncaught (in promise) ReferenceError: URLPattern is not defined
    getPattern routes.ts:60
    matchedRoute routes.ts:231
    _getRoute routes.ts:230
    goto routes.ts:179
    goToCurrentPath testgrid-router.ts:49
    connectedCallback testgrid-router.ts:60
    _insert lit-html.ts:1502
    _commitNode lit-html.ts:1546
    _commitTemplateResult lit-html.ts:1661
    _$setValue lit-html.ts:1475
    render lit-html.ts:2278
    update lit-element.ts:171
    performUpdate reactive-element.ts:1504
    scheduleUpdate reactive-element.ts:1400
    __enqueueUpdate reactive-element.ts:1372
    requestUpdate reactive-element.ts:1311
    __initialize reactive-element.ts:1055
    ReactiveElement reactive-element.ts:1038
    LitElement lit-element.js:93
    TestgridApp testgrid-app.ts:10
    customElement custom-element.ts:60
    __decorate tslib.es6.mjs:58
    <anonymous> testgrid-app.ts:10
routes.ts:60:30
    getPattern routes.ts:60
    matchedRoute routes.ts:231
    find self-hosted:303
    _getRoute routes.ts:230
    goto routes.ts:179
    goToCurrentPath testgrid-router.ts:49
    connectedCallback testgrid-router.ts:60
    _insert lit-html.ts:1502
    _commitNode lit-html.ts:1546
    _commitTemplateResult lit-html.ts:1661
    _$setValue lit-html.ts:1475
    render lit-html.ts:2278
    update lit-element.ts:171
    performUpdate reactive-element.ts:1504
    scheduleUpdate reactive-element.ts:1400
    __enqueueUpdate reactive-element.ts:1372
    InterpretGeneratorResume self-hosted:1332
    AsyncFunctionNext self-hosted:800
    (Async: async)
    requestUpdate reactive-element.ts:1311
    __initialize reactive-element.ts:1055
    ReactiveElement reactive-element.ts:1038
    LitElement lit-element.js:93
    TestgridApp testgrid-app.ts:10
    customElement custom-element.ts:60
    __decorate tslib.es6.mjs:58
    <anonymous> testgrid-app.ts:10
npm run build
❯ npm run build
npm warn Unknown project config "public-hoist-pattern". This will stop working in the next major version of npm.

> [email protected] build
> rimraf dist && tsc && rollup -c rollup.config.js && pnpm analyze -- --exclude dist

../node_modules/urlpattern-polyfill/dist/index.d.ts:5:9 - error TS2300: Duplicate identifier 'URLPattern'.

5   class URLPattern extends Types.URLPattern {}
          ~~~~~~~~~~

  node_modules/@types/node/url.d.ts:1008:19
    1008         interface URLPattern extends _URLPattern {}
                           ~~~~~~~~~~
    'URLPattern' was also declared here.
  node_modules/@types/node/url.d.ts:1009:13
    1009         var URLPattern: typeof _URLPattern;
                     ~~~~~~~~~~
    and here.

../node_modules/urlpattern-polyfill/dist/index.d.ts:6:8 - error TS2300: Duplicate identifier 'URLPatternInit'.

6   type URLPatternInit = Types.URLPatternInit;
         ~~~~~~~~~~~~~~

  node_modules/@types/node/url.d.ts:1006:19
    1006         interface URLPatternInit extends _URLPatternInit {}
                           ~~~~~~~~~~~~~~
    'URLPatternInit' was also declared here.

../node_modules/urlpattern-polyfill/dist/index.d.ts:7:8 - error TS2300: Duplicate identifier 'URLPatternResult'.

7   type URLPatternResult = Types.URLPatternResult;
         ~~~~~~~~~~~~~~~~

  node_modules/@types/node/url.d.ts:1007:19
    1007         interface URLPatternResult extends _URLPatternResult {}
                           ~~~~~~~~~~~~~~~~
    'URLPatternResult' was also declared here.

node_modules/@types/node/url.d.ts:1006:19 - error TS2300: Duplicate identifier 'URLPatternInit'.

1006         interface URLPatternInit extends _URLPatternInit {}
                       ~~~~~~~~~~~~~~

  ../node_modules/urlpattern-polyfill/dist/index.d.ts:6:8
    6   type URLPatternInit = Types.URLPatternInit;
             ~~~~~~~~~~~~~~
    'URLPatternInit' was also declared here.

node_modules/@types/node/url.d.ts:1007:19 - error TS2300: Duplicate identifier 'URLPatternResult'.

1007         interface URLPatternResult extends _URLPatternResult {}
                       ~~~~~~~~~~~~~~~~

  ../node_modules/urlpattern-polyfill/dist/index.d.ts:7:8
    7   type URLPatternResult = Types.URLPatternResult;
             ~~~~~~~~~~~~~~~~
    'URLPatternResult' was also declared here.

node_modules/@types/node/url.d.ts:1008:19 - error TS2300: Duplicate identifier 'URLPattern'.

1008         interface URLPattern extends _URLPattern {}
                       ~~~~~~~~~~

  ../node_modules/urlpattern-polyfill/dist/index.d.ts:5:9
    5   class URLPattern extends Types.URLPattern {}
              ~~~~~~~~~~
    'URLPattern' was also declared here.

node_modules/@types/node/url.d.ts:1009:13 - error TS2300: Duplicate identifier 'URLPattern'.

1009         var URLPattern: typeof _URLPattern;
                 ~~~~~~~~~~

  ../node_modules/urlpattern-polyfill/dist/index.d.ts:5:9
    5   class URLPattern extends Types.URLPattern {}
              ~~~~~~~~~~
    'URLPattern' was also declared here.


Found 7 errors in 2 files.

Errors  Files
     3  ../node_modules/urlpattern-polyfill/dist/index.d.ts:5
     4  node_modules/@types/node/url.d.ts:1006
$ firefox --version
Mozilla Firefox 141.0

/sig testing
/kind bug

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.sig/testingCategorizes an issue or PR as relevant to SIG Testing.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions