Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

app is undefined in configureServer #2184

Copy link
Copy link
@DryaginMihael

Description

@DryaginMihael
Issue body actions

Current behavior

I need to register middleware and use this documentation. My project has react-styleguidist@13.1.4 and webpack@5.98.0. I added the configureServer function in styleguide.config.js, but I get the following error: TypeError: Cannot read properties of undefined (reading 'get') when starting the project via the styleguidist server.

Thoughts:
There was no issue with react-styleguidist@11.x because it used webpack-dev-server@3.x, which was based on express. However, after react-styleguidist@12.0.0, webpack-dev-server was updated to version 4.x, which no longer works on express but uses http.createServer instead. This is why devServer.app does not exist.

To reproduce

  1. clone fork repository https://github.com/DryaginMihael/styleguidist-example
  2. checkout to branch issue-demo (main changes here)
  3. run npm run start
  4. you got error, server did not start

Expected behavior

  • No error should occur when starting the project.
  • app should be defined.
  • I should be able to register middleware.
R-Oscar and ulas-akgun-seismic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.