Relative import paths need explicit file extensions in EcmaScript imports
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by reproducing the reported tsc build with TypeScript 4.7 or 4.9, moduleResolution NodeNext, and @formkit/auto-animate/react. Inspect the generated @formkit/auto-animate/react/index.d.ts and its import of ../index; done when a consuming React package builds without TS2835 under the stated configuration.
Written by the indexing model from the issue text.
Description
I tried adding auto-animate to a react package that is built and exported for use in another repo. The build step for the package looks like this tsc && babel ./src --extensions '.js,.jsx,.ts,.tsx'.
However, during the build, I get a typescript error
error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution'
is 'node16' or 'nodenext'. Did you mean '../index.mjs'?
2 import { AutoAnimateOptions, AutoAnimationPlugin } from "../index";
~~~~~~~~~~
Found 1 error in node_modules/@formkit/auto-animate/react/index.d.ts:2
For reference, the tsconfig.json file looks like this (abbreviated for clarity):
{
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "commonjs",
"jsx": "react-jsx",
"esModuleInterop": true,
"moduleResolution": "NodeNext"
"baseUrl": ".",
"resolveJsonModule": true
},
"include": ["src"],
"exclude": ["node_modules"]
}
This is using:
"@formkit/auto-animate": "^1.0.0-beta.5",
"react": "18.0.0",
"typescript": "4.7.4"
But the issue was also reproduced with "typescript": "4.9.3" and also trying to use other versions of auto-animate 1.0.0-beta.1 and 1.0.0-beta.3
Is there any way for me to use auto-animate right now? I'd be open to changing my tsconfig or adding some plugin to make this work.
- Dominant language
- TypeScript
- Stars
- 13.9k
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from formkit/auto-animate
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
formkit/auto-animate#240 · 6 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
formkit/auto-animate#232 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
formkit/auto-animate#235 · 1 comment · 1 reaction ·
-
Image to Video Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
formkit/auto-animate#233 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
formkit/auto-animate#231 ·
All issues in formkit/auto-animate
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·