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.

Can't import component

See original GitHub issue

Bug Report

Describe the bug

I just wanted to play with docz and check how it works. I’ve created sample component and sample page and I get this error:

WARNING  Compiled with 1 warnings                                                                                                                                        14:18:41

 warning  in ./src/components/Foo/Foo.mdx

"export 'Foo' was not found in './Foo'

Foo.mdx code

---
name: Foo
---
import { Foo } from "./Foo"

# Foo

this is foo:

<Foo>sample</Foo>

Foo.tsx code

import React, { PureComponent } from "react";

export class Foo extends PureComponent {
  render() {
    return this.props.children;
  }
}

Environment

  • OS: macOS 10.13.6
  • Node/npm version: Node 10.8.0

Have you seen something similar earlier?

// Right now I’m unable to start docz server (versions 0.10.0 and later):

✖  fatal     Failed to process your server: TypeError: Cannot read property 'replace' of undefined
    at getRepoUrl (/aaa/node_modules/docz-core/dist/index.js:1:7375)
    at getInitialConfig (/aaa/node_modules/docz-core/dist/index.js:1:9931)
    at Object.init (/aaa/node_modules/docz-core/dist/index.js:1:10148)
    at Promise.all.Array.from.map (/aaa/node_modules/docz-core/dist/index.js:1:10825)
    at Array.map (<anonymous>)
    at DataServer.init (/aaa/node_modules/docz-core/dist/index.js:1:10802)
    at Object.dev (/aaa/node_modules/docz-core/dist/index.js:1:24808)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
szymkabcommented, Aug 16, 2018

When I change it to default export, there are no errors on the build but after I click “Foo” tab on the left I see blue icon of docz on the right and browser crashes (I have to kill chrome process).

zrzut ekranu 2018-08-16 o 10 05 11
1reaction
AntonSerouscommented, May 1, 2019

@pedronauck Could you please reopen? Thanks

UPD: I created a new one, don’t need to reopen, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - ReactJS - Can't import component - Stack Overflow
I'm developing a little single page app and I'm just trying to create my components to import within my main component. TestComponent.jsx import...
Read more >
Cannot import component into PowerApps - Reddit
I am trying to import a component I created into another tenant. I have tried several different ways to get it in there...
Read more >
Cannot import components from @primer/components #1010
Describe the bug Cannot import components from @primer/components. To Reproduce Steps to reproduce the behavior: npx create-react-app my-app Click on ...
Read more >
Cannot import component inside other component - Laracasts
Hello,. I can't seem to figure this out. When I import .vue components from within my app.js file, everything works. Copy Code import...
Read more >
Importing Components in React From Other Files - Upmostly
Importing Components in React From Other Files: Step-by-Step Tutorial ... We cannot import from the file importError.js from within the ...
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