correct-apricot
correct-apricotā€¢2y ago

npm run bootstrap looping error

With a forked instance of refine, after I run npm install and run npm run boostrap I am receiving an error message that appears to loop forever. I am using node version 16.2.0. The error I am seeing output is: ```src/dataProvider/index.ts:172:59 - error TS2345: Argument of type 'TVariables | undefined' is not assignable to parameter of type 'AxiosRequestConfig<any> | undefined'. Type 'TVariables' is not assignable to type 'AxiosRequestConfig<any> | undefined'. Type 'TVariables' is not assignable to type 'AxiosRequestConfig<any>'. 172 const { data } = await httpClient.delete(url, variables);
15 Replies
Omer
Omerā€¢2y ago
Hey @collinpreston šŸ‘‹ , Can you try these versions until we fix issue? node: 16.14.0 npm: 8.3.1
correct-apricot
correct-apricotā€¢2y ago
@Omer , so running npm run boostrap with the versions you listed appears to hang at "IIFE dist/iife/index.js.map 23.62 KB" until I press enter. If I run npm run build after that I receive: lerna ERR! npm run build stderr: āœ˜ [ERROR] [plugin textReplace] contents.replaceAll is not a function ../../node_modules/esbuild/lib/main.js:993:27: 993 ā”‚ let result = await callback2({ ā•µ ^ at file:///Users/collinpreston/Documents/GitHub/refine/packages/core/tsup.config.bundled_d4z2bmb0q6.mjs:71:32 at async callback (/Users/collinpreston/Documents/GitHub/refine/node_modules/esbuild/lib/main.js:993:28) at async handleRequest (/Users/collinpreston/Documents/GitHub/refine/node_modules/esbuild/lib/main.js:721:30) Looks like the error of "sh: tsup: command not found" also shows up
Omer
Omerā€¢2y ago
Thank you for reporting issue. We are investigating this. We will get back to you shortly āš”
correct-apricot
correct-apricotā€¢2y ago
Here is a more full stacktrace: āœ˜ [ERROR] [plugin textReplace] contents.replaceAll is not a function node_modules/esbuild/lib/main.js:993:27: 993 ā”‚ let result = await callback2({ ā•µ ^ at file:///Users/collinpreston/PycharmProjects/mitxonline/frontend/staff-dashboard/refine/packages/core/tsup.config.bundled_2jyjp98t12m.mjs:71:32 at async callback (/Users/collinpreston/PycharmProjects/mitxonline/frontend/staff-dashboard/refine/packages/core/node_modules/esbuild/lib/main.js:993:28) at async handleRequest (/Users/collinpreston/PycharmProjects/mitxonline/frontend/staff-dashboard/refine/packages/core/node_modules/esbuild/lib/main.js:721:30) This error came from the "onLoad" callback registered here: node_modules/esbuild/lib/main.js:855:22: 855 ā”‚ let promise = setup({ @Omer this was my fault, npm was not picking up the 16.14.0 version of node. Sorry for the trouble!
Omer
Omerā€¢2y ago
Cool, does it work as expected?
correct-apricot
correct-apricotā€¢2y ago
Yes, I am able to run the unit tests and they pass (which is what I was originally trying to do). The next step for me is to troubleshoot an issue where our update API is being called hundreds of times if a user modifies one record with useUpdate + undoable, and while the mutation timeout is still active, modifies another record or two and then modified the first record again.
Omer
Omerā€¢2y ago
We look forward to your PR šŸ‘šŸ»
correct-apricot
correct-apricotā€¢2y ago
Hey @Omer , I have created a bug for the issue I think I've found here (https://github.com/pankod/refine/issues/2556). I also included a potential fix for the issue in the bug description (under Additional information). I'd be happy to get started with a PR but wanted to run it past someone first. Thank you again for your help
Omer
Omerā€¢2y ago
Hey @collinpreston šŸ‘‹, Thank you very much! Let's see what we can do šŸš€ Hey @collinpreston , We've created https://github.com/pankod/refine/pull/2559 . We will probably release it tomorrow šŸ’„ Thank you for your understanding and patience
correct-apricot
correct-apricotā€¢2y ago
I'll check it out right now, thank you! @Omer , testing this now and I'm wondering if the following is happening: If I useUpdate record-1 and then update record-1 again while the first notification is still showing, will the first update of record-1 be blown away or replaced by the second update of record-1? From my testing, it appears that only a single API call is being executed thought there are two updates made back-to-back
Omer
Omerā€¢2y ago
Only your last mutation is being executed. Is this a different behavior than you expect?
correct-apricot
correct-apricotā€¢2y ago
Either way is fine. I figured it would work like a queue and place each of the mutations into the queue as unique
Omer
Omerā€¢2y ago
hmmm actually it could be. Can you give an example of this use-case?
correct-apricot
correct-apricotā€¢2y ago
Sure, I'm thinking if I update a field-1 on a record, and then also want to go back and update field-2 on the same record, I would want to make sure that both fields are ultimately updated on the record. With the current implementation I'm not sure what would actually happen with the UI - would the UI for field-1 revert after I update field-2 since the API call for modifying field-1 is never executed?
Omer
Omerā€¢2y ago
hmm you are right. @aliemirs , how about this use case?