#Build Failed throw new Error(`Cannot find the built path for ${specifier}`);

7 messages · Page 1 of 1 (latest)

obsidian wraith
#

Im getting following error on build

▶ src/pages/linkit.astro
file:///C:/Users/Kasun/work/syetalabs/filo/kritikos/node_modules/astro/dist/core/build/generate.js:234
        throw new Error(`Cannot find the built path for ${specifier}`);
              ^

Error: Cannot find the built path for C:/Users/Kasun/work/syetalabs/filo/kritikos/src/components/Common/Accordion/Accordion
    at Object.resolve (file:///C:/Users/Kasun/work/syetalabs/filo/kritikos/node_modules/astro/dist/core/build/generate.js:234:15)
    at generateHydrateScript (file:///C:/Users/Kasun/work/syetalabs/filo/kritikos/dist/entry.mjs?time=1668083057890:1034:48)
    at renderComponent (file:///C:/Users/Kasun/work/syetalabs/filo/kritikos/dist/entry.mjs?time=1668083057890:1822:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Although this file exists and it works on dev mode too

#

hmm weird

I used a relative import

import {
  Accordion,
  AccordionItem,
} from '../Common/Accordion/Accordion';

this was the issue

import {
  Accordion,
  AccordionItem,
} from '@components/Common/Accordion/Accordion';

using a path alias worked....

i've used path alias and relative path on two different astro components, so astro maybe resolving for that one with path alias and fails when comes to relative path

graceful edge
#

ive used relative paths for imports fine. not 100% sure that's the issue

obsidian wraith
#

it seems astro registers one path and doesnt resolve other

sharp chasm
#

same issue still exists except in my case it is throwing from a TSX import in a .mdx file and I'm not sure how or if it's possible to add an import alias.

ideas?

#

oops nvm, found a thread

#

just need to remove the file extension from the import