[Bug] cannot find namespace 'google' on version 1.6.1

Open
#856 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
api, frontend

Research direction

Start by reproducing the typecheck failure with the provided tsconfig files against versions 1.5.5 and 1.6.1, then inspect the recent tsLib-related change. Done means the reported google namespace references typecheck successfully under the supported configuration, with a regression test or reproduction added if the repository provides a suitable location.

Written by the indexing model from the issue text.

Description

bug
Description

When updating from 1.5.5 to 1.6.1 I noticed my typecheck start failing anywhere I'm referencing google's namespace.

I see in the most recent version there was a change to tsLib, maybe related?

I also saw this old issue thread https://github.com/visgl/react-google-maps/issues/519


For reference in case it's helpful:

Here are my tsconfigs (I extend a base one in a monorepo)

// base.json
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Default",
  "compilerOptions": {
    "composite": false,
    "declaration": true,
    "declarationMap": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "inlineSources": false,
    "isolatedModules": true,
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "preserveWatchOutput": true,
    "skipLibCheck": true,
    "strict": true,
    "strictNullChecks": true,
    "resolveJsonModule": true
  },
  "exclude": ["node_modules"]
}

// react-library.json

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "React Library",
  "extends": "./base.json",
  "compilerOptions": {
    "lib": ["ES2015", "DOM"],
    "module": "ESNext",
    "target": "ES6",
    "jsx": "react-jsx",
    "noEmit": true,
    "types": [
      "node",
      "@testing-library/dom",
      "@testing-library/jest-dom",
      "@testing-library/user-event",
      "@testing-library/react",
      "vitest/globals"
    ]
  }
}
// ui package config

{
  "extends": "@company/config.typescript/react-library.json",
  "include": [
    ".",
    "../../analytics/src/providers/AnalyticsProvider/PageProvider"
  ],
  "compilerOptions": {
    "lib": ["dom", "dom.iterable"]
  },
  "exclude": ["dist", "build", "node_modules"]
}
Steps to Reproduce

Will get one up when I have a minute here

Environment
  • Library version: 1.6.1
  • Google maps version: weekly
  • Browser and Version: Chrome 141.0.7390.108 ARM
  • OS: Mac OS Sequoia 15.5
Logs

Dominant language
TypeScript
Stars
2k
Forks
195
Avg merge
6h 26m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from visgl/react-google-maps

All issues in visgl/react-google-maps

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.