Open a-x- opened 4 weeks ago
tsconfig.json:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"outDir": "./dist/",
"lib": ["es2018", "dom", "ES2020.Promise", "DOM.Iterable", "es2019.array", "ES2021.String"],
"sourceMap": true,
"strict": true,
"module": "esnext",
"jsx": "react-jsx",
"target": "es2017",
"rootDir": ".",
"allowJs": true,
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"esModuleInterop": true,
"skipLibCheck": true,
"downlevelIteration": true,
"importHelpers": true,
"experimentalDecorators": true,
"preserveSymlinks": true,
"useUnknownInCatchVariables": false,
// COPY: /webpack/tsconfig.json
// COPY: /webpack/webpack.base.config.ts#alias
// COPY: /.storybook/main.ts
"paths": {
"@proterm/core": ["./src/core"],
"@terminal/*": ["./src/*"]
},
"plugins": [
{
"name": "typescript-plugin-css-modules",
"options": {
"customMatcher": "\\.less$"
}
}
]
},
"types": ["node", "jest", "@testing-library/jest-dom", "@testing-library/react"],
"include": ["./src/"],
"exclude": ["**/__tests__", "**/*.stories.*", "**/__mock__/*.ts", "**/node_modules", "**/lib"]
}
So, @proterm/core is an alias to the big file with re-exports and re-exports of re-exports
Moreover, selectStore
is declared as weird as:
function selectStore<State>(store: ReducerStore<State>): (state: any) => State;
function selectStore<State>(store: ReducerStore<State>, state: any): State;
function selectStore<State>(store: ReducerStore<State>, state?: any) {
if (state) {
return select(store, state);
}
function selectStoreCurried(stateCurried: State) {
return select(store, stateCurried);
}
(selectStoreCurried as any)[widgetScope.symbol] = true;
return selectStoreCurried;
}
(selectStore as any)[widgetScope.symbol] = true;
export default selectStore;
Looks like this is a problem, because
import { syncSettings } from '@proterm/core';
export function useOrders() {
return syncSettings;
}
works as syncSettings hasn't multiple declarations.
In the save moment, I cannot move other functions w/o referring selectStore
or things like this.
For instance this does not work too:
import { useCallback, useRef, useState } from 'react';
import { useLatest } from 'react-use';
type Opts = { lastOnly?: boolean };
type Set<D> = (data: D) => void;
export function useSubscriptionProvider<T extends Set<D>, D>(name: string, data: D, opts?: Opts) {
const { lastOnly = true } = opts || {};
const [buffer, setBuffer] = useState<D[]>([]);
const queueRef = useLatest(buffer);
const saveBuffer = useCallback((data: D) => setBuffer((q) => [...q, data]), []);
const ref = useRef<T>();
console.log('hm', { lastOnly, buffer, queueRef, saveBuffer, ref, name, data });
}
Currently problem is a useLatest
from 'react-use',
Minimal not working example:
import { useLatest } from 'react-use';
export function useUseLatest (data: string) {
return useLatest(data);
}
I'm seeing this issue too.
When I try to Move to a New File in vscode, the following errors appear in the Extension Host output.
2024-08-16 14:51:23.411 [error] [vscode.typescript-language-features] provider FAILED
2024-08-16 14:51:23.411 [error] Error: <semantic> TypeScript Server Error (5.5.4)
Debug Failure. False expression: Changes overlap
Verbose Debug Information: {"pos":0,"end":1125} and {"pos":455,"end":455}
Error: Debug Failure. False expression: Changes overlap
Verbose Debug Information: {"pos":0,"end":1125} and {"pos":455,"end":455}
at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:174932:15
@navya9singh any update on this?
@navya9singh @aureliopetrone @sheetalkamat this looks like the fix for a similar issue however it's not working for me https://github.com/microsoft/TypeScript/pull/59625
I have just downloaded the newest version and it doesn't seem to work for me.
Additionally there is some comments about disabling/enabling "typescript.tsserver.experimental.useVsCodeWatcher". I have tried both enabled and disabled but neither resolves for me https://github.com/microsoft/TypeScript/issues/59603#issuecomment-2285035053
This seems more or less duplicate of #58740
I can confirm that this bug is still present & refactoring is broken for several minor & fix versions. Any plans to fix this?
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
What I tried already:
--disable-extensions
to ensure it's not a problem with a package.typescript.tsserver.enableTrace
It worked a few versions before. I don't know exactly what version was okay.
UPD: not working:
not working:
not working:
working:
working:
working:
I though @ import aliases is a problem, however this works too:
error: