Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support absolute path #62

Open
vsachini opened this issue Dec 11, 2020 · 2 comments
Open

Support absolute path #62

vsachini opened this issue Dec 11, 2020 · 2 comments

Comments

@vsachini
Copy link

vsachini commented Dec 11, 2020

Does next-images supports absolute path?
I'm trying to import a .svg but I'm getting an error.

Code:
image

Error:
Error: /Users/v/project/src/components/home/Header.tsx: Cannot find module 'src/assets/menuIcon.svg' from '/Users/v/project/src/components/home'

next.config.js:

const withImages = require('next-images')

module.exports = withImages({
esModule: true
})

@arefaslani
Copy link
Member

@vsachini Sorry for the late response, yes I think it should support it. Have you installed babel plugin module resolver or something like that?

@dustinlacewell
Copy link

Hey I don't think absolute paths are working:

Error: Cannot find module '/home/ldlework/src/ldlework-next/apps/ldlework-dot-com/projects/category-1/project-a/odd.jpg'

Changing it to a relative path lets it get imported no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants