The `extensions.js` file throws an error when i try to run an extension
See original GitHub issueDescribe the bug
I am trying to run a soul extension inside the soul/core
folder but the code is throwing an error in the /core/src/extensions.js
file, i have followed the instructions in here to run the extension.
To Reproduce
-
Go to the
soul/core
folder and create a folder named_extensions
-
Create a file named
api.js
inside the_extensions
folder and copy and paste the sample extension code from here -
Add the path of your extension in your
.env
fileEXTENSIONS=./_extensions
-
Run the project
npm run dev
Expected behavior
When i run the project, it throws an error in this line, it can’t require
the _extensions/api.js
file,
Screenshots
Additional context The code works fine when i modify the path of the extension like this
- const apiExtensions = require(`${extensionsPath}/${extension}`);
+ const apiExtensions = require(`../${extensionsPath}/${extension}`);
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
ESLint throws error when using mandatory file extensions in ...
In latest Node 16.8, file extensions are now mandatory in import (e.g. import { getFoo } from './api.js'; ). At the same time...
Read more >Compiled JavaScript import is missing file extension #40878
If I try to import from './dep.ts' , the compiler gives me error TS2691: An import path cannot end with a '.ts' extension....
Read more >JavaScript errors in Dreamweaver - Adobe Support
In the Extension Manager, select each extension. Choose File > Remove Extension.
Read more >9 essential VS Code extensions for TypeScript - LogRocket Blog
Use VS Code extensions like TypeScript ESLint, TypeScript Toolbox, and TypeScript Importer to help configure and use TypeScript easily.
Read more >JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thevahidal Thank you so much for your answer. I just changed it to an absolute path and everything is working fine now.
Issue created. https://github.com/thevahidal/soul/issues/78