variable-lime
variable-lime2y ago

How to use Refine with Javascript

Hello, What do I have to do to setup Refine to use JavaScript instead of typescript? I have checked the Javascript example but the setup is not obvious to me. Thanks for your help.
11 Replies
kapa.ai
kapa.ai2y ago
Hey @kataiwo2023! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave: ---------------------- To set up Refine with JavaScript, you can follow the example provided in the documentation. First, you need to create a new Refine project using the create-refine-app command. Here's the command to create a project with the JavaScript example:
npm create refine-app@latest -- --example with-javascript
npm create refine-app@latest -- --example with-javascript
This command will create a new Refine project using the JavaScript example. You can then navigate to the project folder and start the development server. For more information, you can check the JavaScript example documentation (https://refine.dev/docs/examples/javascript). ----------------------
kapa.ai
kapa.ai2y ago
<@1085267315102335057> kapa.ai is still learning and improving, please let us how it did by reacting below
literary-plum
literary-plum2y ago
when you use .js extension, is it not work ?
variable-lime
variable-lime2y ago
I actually started a TypeScript app which I am new to, but I thought I could learn along. Then I added Editorjs with a .js extension, but it gave an error reading the Editorjs package. So, I now thought I could make the entire app a javascript, that's why I asked the question.
literary-plum
literary-plum2y ago
yes you can. what is editorjs ? i don't think it's came from refine
variable-lime
variable-lime2y ago
It is an excelletnt text editor.
literary-plum
literary-plum2y ago
what is the error ?
variable-lime
variable-lime2y ago
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'firstInput') This is the error and when I checked the details it was from the EditorJs library. I know this works flawlessly in Javascript, that's why I was trying to explore restarting the project in Javascript. Thanks.
literary-plum
literary-plum2y ago
TypeScript or JavaScript should not differ unless has something went wrong on bundling process. But i think it's a long shot Do you have firstInput variable somewhere in your code ? Can you double check your undefined controls please
variable-lime
variable-lime2y ago
No, I checked that the error referenced the EditorJs library. I've googled and it seems there is a problem using the Editor Js with TypeScript.
literary-plum
literary-plum2y ago
I understand. I suggest you too open an issue on Editorjs forums. but if you think it's related to refine with editorjs and if you reproduce the problem with working application on codesandbox or any other platform, i will happy to debug