Missing file extension
Unanswered
American Chinchilla posted this in #help-forum
American ChinchillaOP
Hello, I am trying to add a path alias to my component folder inside a private route. But i get the error as mentioned in the title. Here is my code:
my tsconfig:
Folder structure:
import React from 'react'
import {} from '@/marketingComponents';// eslint Missing File Extension
const MarketingLayout = ({ children }: { children: React.ReactNode }) => {
return <div></div>
}
export default MarketingLayout
my tsconfig:
"paths": {
"@/*": ["./src/*"],
"@/components": ["./src/components/index"],
"@/marketingComponents": ["./src/app/(marketing)/_components/index"]
}
Folder structure:
/src
/components
index
/app
/(marketing)
/_components
index.js
10 Replies
American ChinchillaOP
the path alias error is only for marketing Components
Why are you using a .js file in a ts project? Especially for the index
I feel as if that may be the cause
American ChinchillaOP
@Luke i use it to export all exports in a single file
It only causes error for that import alias
For the components alias it also has an index.js file and works fine
I not sure if it has to do with the path that it cant use () or _ characters
I might test for that
Yeah, I totally get barrel files
But a barrel file can be a typescript file too