Open lighthaus205 opened 6 months ago
I could fix it by simply adding a new file at the root of my project called index.d.ts
with the contents: declare module 'ecctrl'
Using NextJS v14.04
I've faced the same issue on Vite project. I've just walked it around with provided code snippet
// @ts-expect-error miss type declaration
import Ecctrl from 'ecctrl'
const Component = () => {
return (
<Ecctrl>
<mesh />
</Ecctrl>
)
}
I hope this type declaration issue will be fixed with next patch
We can add a declaration file to our project to fix this:
// ecctrl.d.ts
declare module "ecctrl" {
export * from "ecctrl/src/Ecctrl";
import Ecctrl from "ecctrl/src/Ecctrl";
export = Ecctrl;
}
That didn't work: lib type constraints conflicted with mine.
After some research I've found a last version of the package that has a type declaration file. It's 1.0.58
. And it seems like all versions after 1.0.58
does not have a type declaration file. Check out npm link https://www.npmjs.com/package/ecctrl/v/1.0.59?activeTab=code.
I guess it is a kind of a ci problem. Because locally I can build the package with a type declaration file (current main) running a npm run build
command.
@ErdongChen-Andrew Sorry for disturbance. Maybe this information will be helpfull for you. Btw do you have time to check what is broken?
Thank you @myznikovgleb ! My bad! In version 1.0.67, a type declaration file should be included. Thanks again for pointing this out!
Is the declaration file just meant to say export * from '../src/Ecctrl.tsx'
? That's what I see in my node_modules
with 1.0.67
.
This seems to cause TypeScript to attempt compilation of the Ecctrl.tsx
file but it won't work if that file cannot be compiled against the tsconfig.json
file used in my project. I was only able to get it to work by cloning this repo and running tsc
to get the actual declaration files and the depending on the cloned repo instead.
Is the declaration file just meant to say
export * from '../src/Ecctrl.tsx'
? That's what I see in mynode_modules
with1.0.67
.This seems to cause TypeScript to attempt compilation of the
Ecctrl.tsx
file but it won't work if that file cannot be compiled against thetsconfig.json
file used in my project. I was only able to get it to work by cloning this repo and runningtsc
to get the actual declaration files and the depending on the cloned repo instead.
đ¤ Emm, not sure about the problem. 1.0.67 was able to fix the declaration issue in my test project.
Still having this issue on latest version, any news?
Still having this issue on latest version, any news?
Just made some updates, try on v1.0.75. Let me know if it works.
I still have this issue with "ecctrl": "^1.0.77"
. I've tried the suggested type declarations, but they didn't work.
Indeed, the d.ts
file is missing in the node_modules:
I've cloned this repo and tested the build script and it generates the type definitions. Unfortunately it seems like a CI bug indeed so I can't really help with a PR.
My bad, @tiborsaas. version 1.0.78
should include the d.ts file. Missing it in 1.0.76
and 1.0.77
đ
Hi, I am excited to use ecctrl, however I am getting the following error when importing the module.
Type error: Could not find a declaration file for module 'ecctrl'. '/Users/konstantinlackner/Dev/konchord-experience-demo/node_modules/ecctrl/dist/Ecctrl.js' implicitly has an 'any' type. Try npm i --save-dev @types/ecctrl if it exists or add a new declaration (.d.ts) file containing declare module 'ecctrl';
I tried
npm i --save-dev @types/ecctrl
but it is not in the npm registry.Any idea how to fix this?