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

TypeScript json import in with-typescript example doesn't work even in js files #9883

Closed
talentlessguy opened this issue Dec 30, 2019 · 5 comments
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@talentlessguy
Copy link

Bug report

Describe the bug

When I try to import json in a js file, I get resolve error

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a typescript project create-next-app --example with-typescipt app
  2. Try to import json (import { version } from '../package.json')

Expected behavior

it should import json without any problems because json resolution is set to true by default in tsconfig.json

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: Manjaro Linux 5.4.2
  • Version of Next.js: 9.1.6

Additional context

typescript version: 3.7.4

@talentlessguy talentlessguy changed the title TypeScript json import don't work even in js files TypeScript json import in with-typescript example doesn't work even in js files Dec 30, 2019
@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers help wanted labels Dec 30, 2019
@NileshPatel17
Copy link

I did not find any issue. It worked with tsx as well js file.
Steps performed:-

  1. Created a typescript project with create-next-app --example with-typescipt next-typescript-app
  2. imported version, name from package.json

Here is the repo i created.
Take a look /pages/index.tsx and pages/hola.js files.

@talentlessguy
Copy link
Author

talentlessguy commented Jan 2, 2020

@NileshPatel17

here's a reproduction repository

Message:

./pages/index.js
Module not found: Can't resolve 'three/fonts/helvetiker_regular.typeface.json' in '/home/v1rtl/Coding/v1rtl-2/pages'

@NileshPatel17
Copy link

@talentlessguy path is incorrect. correct path is
import Helvetica from 'three/examples/fonts/helvetiker_regular.typeface.json'

@talentlessguy
Copy link
Author

@talentlessguy path is incorrect. correct path is
import Helvetica from 'three/examples/fonts/helvetiker_regular.typeface.json'

ok, my bad. closing the issue

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants