Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Fix OrbitControls docs missing ".js" extension #671

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nwittwer
Copy link

@nwittwer nwittwer commented May 1, 2024

Added missing .js suffix for importing OrbitControls from the three package (since it's not a TS file).

Before:

import { OrbitControls } from 'three/addons/controls/OrbitControls

After:

import { OrbitControls } from 'three/addons/controls/OrbitControls.js

I'm using this in a Nuxt project (@tresjs/nuxt package)—maybe I just need to configure my TS Module Resolutions or some other TS settings? Using the default Nuxt tsconfig.json:

{
  "extends": "./.nuxt/tsconfig.json"
}

Update 1
Modifying the project-level tsconfig.json to the following enables .js files to resolve:

{
  "extends": "./.nuxt/tsconfig.json",
  "compilerOptions": {
    "moduleResolution": "node",
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./*"
      ],
      "@/*": [
        "./*"
      ],
      "*": [
        "*",
        "*.ts",
        "*.js"
      ]
    },
  }
}

Added missing `.js` suffix for importing [OrbitControls](https://threejs.org/docs/#examples/en/controls/OrbitControls)
Copy link

netlify bot commented May 1, 2024

Deploy Preview for tresjs-docs ready!

Name Link
🔨 Latest commit fa2bab1
🔍 Latest deploy log https://app.netlify.com/sites/tresjs-docs/deploys/6631fd263d318e000842b23f
😎 Deploy Preview https://deploy-preview-671--tresjs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant