Module not found: error when using <Link>
See original GitHub issuecode example:
import Link from "@primer/components/src/Link";
import React from "react";
interface ExternalLinkProps {
src: string;
text: string;
newTab?: boolean;
}
export const ExternalLink = (props: ExternalLinkProps) => {
const target: string = props.newTab ? `_blank` : `_self`;
const rel: string | undefined = props.newTab
? `noreferrer noopener`
: undefined;
return (
<Link href={props.src} target={target} rel={rel}/>
);
};
While trying to run npm start
in console, it won’t render, but show the following error:
Module not found: Can't resolve './utils/elementType' in '{my path}/node_modules/@primer/components/src'
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Link module not found Error - Forums - IBM Support
The solution is to change every instance of the function itemFromId in your layoutDXL to be the function item(fullName) instead. The only problem...
Read more >Module not found: Error: Can't resolve 'url' [Solved] | bobbyhadz
The error "Module not found: Error: Can't resolve 'url'" occurs because there has been a breaking change in Webpack version 5. To solve...
Read more >ModuleNotFoundError: no module named Python Error [Fixed]
As the name implies, this error occurs when you're trying to access or use a module that cannot be found. In the case...
Read more >How to fix error "Module not found: Error: Can't resolve 'url ...
I am stuck on the 'url' error, have tried to run 'npm i url' in my terminal, added a webpack.config.js file with code...
Read more >module-not-found - Next.js
The module you're trying to import is not installed in your dependencies ... When importing a module from npm this module has to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, that works. but the bundle size is much bigger then. Waiting for 19.0.0!
Thannks for the follow up!