-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Closed
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers
Description
Examples bug report
Example name
custom-server-typescript
svg-components
with-absolute-imports
Describe the bug
with the svg-components and absolute import the svg's are not found
[ error ] ./components/cowsay.tsx
Error: Cannot find module 'svg/cat.svg' from '/Users/Projects/Playground/next/components'
with tslint it does not see .jpg, .svg or any images as paths but instead as modules
Absolute Paths:
Cannot find module 'svg/cat.svg.ts(2307)
Cannot find module 'images/pexels-photo.jpg'.ts(2307)
Relative Paths:
Cannot find module '../assets/svg/cat.svg'.ts(2307)
Cannot find module '../assets/images/pexels-photo.jpg'.ts(2307)
( as i side note i added paths to my tsconfig )
"paths": {
"images/*": ["assets/images/*"],
"svg/*": ["assets/svg/*"]
},
To Reproduce
https://github.com/PaulPCIO/next.js-issues-svg-absolute-imports-tslint
uncomment lines in components/ImageExamples.tsx
- https://github.com/PaulPCIO/next.js-issues-svg-absolute-imports-tslint/blob/e3b6490d2456abcf6c0f5f4caba081cc28662c82/components/ImageExamples.tsx#L4
- https://github.com/PaulPCIO/next.js-issues-svg-absolute-imports-tslint/blob/e3b6490d2456abcf6c0f5f4caba081cc28662c82/components/ImageExamples.tsx#L42
Expected behavior
- Expect SVG's to import from absolute paths
Expect tslint to recognise image importations
Screenshots
#issue 1:
import Absolute_CatSVG from 'svg/cat.svg'
System information
- OS: macOS
- Version of Next.js: 8.1.0
Metadata
Metadata
Assignees
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers