#Paths issue

7 messages · Page 1 of 1 (latest)

flat delta
#

I am having an issue with paths that is flumoxing me. In my tsconfig I have

        "baseUrl": "./",
        "paths": {
            "@/*": ["core/*"]
        }

In core/configuration/secrets.ts import { loadPlugin } from '@/plugin-manager'; works as expected.

But in .sparkbot.config.ts I get an error that the module can not be found.

I moved .sparkbot.config.ts to the sparks directory just as a troubleshooting step, and get same error there.

visual escarp
#

!:paths

pallid violetBOT
#
tjjfvi#0
`!t6:paths-are-not-magic`:

The paths and baseUrl compiler options don't cause any remapping of imports paths, they only inform TS of existing mappings, which you'll have to setup with some other tool.

baseUrl is a pretty well-supported option (e.g. using the NODE_PATH environment variable with node or resolve.modules with webpack).
paths can be trickier to setup, (especially with node see this for node), and you may find it to not be worth the effort.

visual escarp
#

Depending on your toooling, maybe hte path rewriting is being handled by some other tool, but I'd guess that whatever 'sparkbot' is doing to read the config file, it's not doing any sort of path rewriting.

flat delta
#

So, to be clear, at this point I am just dealing with IDE errors. I am using Bun for execution, and it is doing just fine. It is just VSCode that is giving the error.

#

Seems like VSCode may have issues with it. Based on what you linked, I guess I am not going to bother, lol!

#

TY