question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The `extensions.js` file throws an error when i try to run an extension

See original GitHub issue

Describe 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

  1. Go to the soul/core folder and create a folder named _extensions

  2. Create a file named api.js inside the _extensions folder and copy and paste the sample extension code from here

  3. Add the path of your extension in your .env file

    EXTENSIONS=./_extensions
    
  4. 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 Screen Shot 2022-12-10 at 10 58 50 PM

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:closed
  • Created 9 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AbegaMcommented, Dec 11, 2022

@thevahidal Thank you so much for your answer. I just changed it to an absolute path and everything is working fine now.

0reactions
thevahidalcommented, Dec 11, 2022

Hey @IanMayo, No there’s not a strong reason behind it, it was just easier as Soul is basically a CLI. But I can change it so it supports relative paths from where you run the CLI.

Issue created. https://github.com/thevahidal/soul/issues/78

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found