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

Usage example? #3

Open
7yl4r opened this issue May 22, 2024 · 1 comment
Open

Usage example? #3

7yl4r opened this issue May 22, 2024 · 1 comment

Comments

@7yl4r
Copy link
Owner

7yl4r commented May 22, 2024

I can't get this to import into an example react app from following the advice in the template's README.
Maybe it is out of date?
Can someone check my methods below or provide alternative guidance?

Steps to reproduce:

 npx create-react-app react-vocab-suggester-test-app --template typescript
 cd react-vocab-suggester-test-app/
 npm install git+ssh://[email protected]/7yl4r/react_component
 sed -i '1iimport { Button } from "@7yl4r/vocab_suggester";\n' src/App.tsx 
 npm run start

This will yield the following error:

Compiled with problems:
ERROR in src/App.tsx:1:24
TS2307: Cannot find module '@7yl4r/vocab_suggester' or its corresponding type declarations.
  > 1 | import { Button } from "@7yl4r/vocab_suggester";
      |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    2 |
    3 | import React from 'react';
    4 | import logo from './logo.svg';

I can confirm that @7yl4r/vocab_suggester has been added to the package.json.
I tried clearing the cache as suggested by ChatGPT and did this twice to be sure.

@Dylan-Pugh
Copy link
Collaborator

Just chiming in to say I can reproduce this. As a React novice I'm not sure the best way to debug, but I know that create-react-app is deprecated, so I wonder if that's a contributing factor.

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

No branches or pull requests

2 participants