question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: error when using <Link>

See original GitHub issue

code 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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
assapircommented, May 7, 2020

yes, that works. but the bundle size is much bigger then. Waiting for 19.0.0!

0reactions
assapircommented, May 10, 2020

Thannks for the follow up!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found