Andarist / Andarist/react-textarea-autosize

Cannot use import statement outside a module

Aperta
#420 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
2.4k
Fork
247
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### `Cannot use import statement outside a module` when using with react-router (vite)

Hi,

I'm trying to use `react-textarea-autosize` with `react-router` using vite, but I'm getting the following error:

```
Cannot use import statement outside a module
```

### Steps to Reproduce:
1. Setup a React project with Vite and react-router.
2. Import and use `react-textarea-autosize`.

### Expected Behavior:
The component should render without errors when imported.

### Actual Behavior:
I receive the error mentioned above.

I tried the recommended fix from [Remix ESM/CJS](https://remix.run/docs/en/main/guides/vite#esm--cjs), but none of these solutions resolved the issue.

### Reproduction Link:
Here's a minimal reproduction in Codesandbox: [https://codesandbox.io/p/devbox/j9dp2j](https://codesandbox.io/p/devbox/j9dp2j)

Thanks for your help!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.