Open TechQuery opened 1 year ago
Does it also still fail with Parcel 2.8.2?
Does it also still fail with Parcel 2.8.2?
@parcel/transformer-typescript-types: The inferred type of 'searchFilter' references an inaccessible 'this' type. A type
annotation is necessary.
but TypeScript in VS Code told me nothing wrong.
It's working for me: https://github.com/mischnic/parcel-issue-8703
It's working for me: https://github.com/mischnic/parcel-issue-8703
Could you test a more complex case? such as the context I shown above: https://github.com/idea2app/MobX-RESTful/commit/0370678fd2592094c0225662303a4dd2510c20fd#diff-780bc523b57f373918475f4b3d1d120f938678b33c03bf79ce4f7b20b7085254R63-R69
$ git clone https://github.com/idea2app/MobX-RESTful
$ pnpm install
$ pnpm exec parcel build
β¨ Built in 2.18s
dist/index.js 14.1 KB 609ms
dist/index.esm.js 18.07 KB 88ms
(And this is exactly the reason why I wanted you to prepare some isolated reproduction...)
It's working for me: https://github.com/mischnic/parcel-issue-8703
Could you test a more complex case? such as the context I shown above: https://github.com/idea2app/MobX-RESTful/commit/0370678fd2592094c0225662303a4dd2510c20fd#diff-780bc523b57f373918475f4b3d1d120f938678b33c03bf79ce4f7b20b7085254R63-R69
@mischnic look here, it's in a sub package, the permanent link directs to the error lines.
$ git clone https://github.com/idea2app/MobX-RESTful
$ pnpm install
$ cd wrapper/Strap
$ pnpm install
$ pnpm build
> mobx-strapi@0.4.0-rc.6 build wrapper/Strapi
> rm -rf dist/ && parcel build
@parcel/transformer-typescript-types: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
wrapper/Strapi/node_modules/.pnpm/koajax@0.8.3/node_modules/koajax/dist/index.d.ts:22:1
21 | };
> 22 | enum FileMethod {
> | ^^^^^ Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
23 | text = "readAsText",
24 | dataURL = "readAsDataURL",
β¨ Built in 5.40s
dist/index.js 3.24 KB 245ms
dist/index.esm.js 3.68 KB 68ms
dist/index.d.ts 2.32 KB 98ms
@mischnic To replace the class name with this
can reproduce:
https://github.com/idea2app/MobX-RESTful/blob/bb127f4e22e7fdeedea5cc9aa2bfc1295fc6a988/wrapper/Strapi/source/index.ts#L64
Use this branch: https://github.com/idea2app/MobX-RESTful/tree/update-bundler
Any updateοΌ
Does it also still fail with Parcel 2.8.2?
- Same error in Parcel 2.8.2 & TypeScript 4.9.4
- Same error with one more warning in Parcel 2.8.2 & TypeScript 4.7.4:
@parcel/transformer-typescript-types: The inferred type of 'searchFilter' references an inaccessible 'this' type. A type annotation is necessary.
but TypeScript in VS Code told me nothing wrong.
parcel@2.11.0
& typescript@5.3.3
throw the same error with the same code:
https://github.com/idea2app/MobX-RESTful/blob/a450bafecd531d91f2a306a47bf763dbf5e6b12a/wrapper/Strapi/source/index.ts#L71
Does it also still fail with Parcel 2.8.2?
- Same error in Parcel 2.8.2 & TypeScript 4.9.4
- Same error with one more warning in Parcel 2.8.2 & TypeScript 4.7.4:
@parcel/transformer-typescript-types: The inferred type of 'searchFilter' references an inaccessible 'this' type. A type annotation is necessary.
but TypeScript in VS Code told me nothing wrong.
parcel@2.11.0
&typescript@5.3.3
throw the same error with the same code: https://github.com/idea2app/MobX-RESTful/blob/a450bafecd531d91f2a306a47bf763dbf5e6b12a/wrapper/Strapi/source/index.ts#L71
@mischnic This bug disappears with the latest parcel@2.12.0
& typescript@5.5.4
finally π
- Same error in Parcel 2.8.2 & TypeScript 4.9.4
- Same error with one more warning in Parcel 2.8.2 & TypeScript 4.7.4:
@parcel/transformer-typescript-types: The inferred type of 'searchFilter' references an inaccessible 'this' type. A type annotation is necessary.
but TypeScript in VS Code told me nothing wrong.
parcel@2.11.0
&typescript@5.3.3
throw the same error with the same code: https://github.com/idea2app/MobX-RESTful/blob/a450bafecd531d91f2a306a47bf763dbf5e6b12a/wrapper/Strapi/source/index.ts#L71@mischnic This bug disappears with the latest
parcel@2.12.0
&typescript@5.5.4
finally π
Unfortunately, this error comes out with the same verisons... https://github.com/idea2app/MobX-RESTful/actions/runs/10687983037/job/29626792910#step:7:51
The source code is here: https://github.com/idea2app/MobX-RESTful/pull/16/files#diff-780bc523b57f373918475f4b3d1d120f938678b33c03bf79ce4f7b20b7085254
π Configuration
package.json
tsconfig.json
π€ Expected Behavior
Compile TypeScript source code as shown below successfully:
π― Current Behavior
π Possible Solution
If I replace
this
with the class, this error disappeared:π¦ Context
Real world code:
https://github.com/idea2app/MobX-RESTful/pull/9/commits/0370678fd2592094c0225662303a4dd2510c20fd#diff-780bc523b57f373918475f4b3d1d120f938678b33c03bf79ce4f7b20b7085254R63-R69
π Your Environment