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.

Cannot resolve Playground

See original GitHub issue

Hey! I’ve followed the tutorial to implement snapguidist on my react-styleguidist but I’m gettint the following error when I run the start script:

FAIL  Failed to compile

./node_modules/react-styleguidist/lib/rsg-components/Playground/index.js
Module not found: Can't resolve 'rsg-components/Playground/Playground' in '/<path-to-project>/node_modules/react-styleguidist/lib/rsg-components/Playground'

Here’s the alias part of the loaded webpackconfig:

{ entry: 
   [ '/<path-to-project>/packages/css-packs/core-styles/src/index.scss',
     '/<path-to-project>/node_modules/react-styleguidist/lib/index',
     '/<path-to-project>/node_modules/react-dev-utils/webpackHotDevClient.js',
     '!!style-loader!css-loader!codemirror/lib/codemirror.css',
     '!!style-loader!css-loader!rsg-codemirror-theme.css',
     '!!style-loader!css-loader!/<path-to-project>/node_modules/snapguidist/lib/styles.css' ],
  output: 
   { path: '/<path-to-project>/styleguide',
     filename: 'build/[name].bundle.js',
     chunkFilename: 'build/[name].js' },
  resolve: 
   { 
     extensions: 
     [
        '.js',
        '.jsx',
        '.json',
        '.js',
        '.jsx',
        '.ts',
        '.tsx',
        '.json',
        '.less',
        '.scss',
        '.sass',
        '.styl',
        '.css'
      ],
     alias: {
      'rsg-components/Playground/PlaygroundRenderer': 'react-styleguidist/lib/rsg-components/Playground/PlaygroundRenderer',
      'rsg-components/Playground': '/<path-to-project>/node_modules/snapguidist/lib/components/Playground',
      'rsg-components/Preview': '/<path-to-project>/node_modules/snapguidist/lib/components/Preview',
      'rsg-codemirror-theme.css': 'codemirror/theme/base16-light.css',
      react: 'preact-compat',
      'react-dom': 'preact-compat',
      'rsg-components': '/<path-to-project>/node_modules/react-styleguidist/lib/rsg-components' 
    },
  modules: [ './node_modules' ] }
  ...
}

(I’ve used <path-to-project> here just to shorten the output)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
MicheleBertolicommented, Apr 15, 2018
0reactions
kaisermanncommented, Apr 17, 2018

Oops, my bad.

I’m using preact with the appropriate react alias, but snapguidist uses the fiber API which preact-compat doesn’t provide:

var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Playground can't find symbols in s… | Apple Developer Forums
I have a set of playgrounds that I'm using with a with a private (Swift) framework that is hosted, alongside my app targets,...
Read more >
swift playground can't find any type - Stack Overflow
I'm new to swift playground, and I tried to create a instance of Type like Scene or Graphic. But every time I try...
Read more >
Why "error: cannot find 'Task' in scope" in Xcode Playground?
In Xcode Version 13.0 beta 3 (13A5192i), I just paste this example: @MainActor class Test { fileprivate var value: Int? func tryMe() {...
Read more >
Can't find Trailhead Playground - Salesforce Developers
Can't find Trailhead Playground. This is my first day using this, and I have already run into an issue. So I am on...
Read more >
lightning web components - Unable to Resolve UI-Card
This is mentioned in one of the issues of the repository. The ui-card is a base component and is not present in 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