Skip to content

[BUG] Update from 5.x to 7.x throws error when deployed #305

@corby

Description

@corby

What / Why

I just upgraded from semver@5.x to semver@latest and now my react app crashes
Seems to be related to the lazyRequire function.
Looks like webpack is optimizing out the functions.

When

import semver from "semver";
....
this.isAppValid = ver => {
return semver.valid(ver) !== null;
}

Where

semver_sync:2 Uncaught Error: Cannot find module './functions/valid'
at webpackEmptyContext (semver_sync:2)
at lazyRequire (index.js:3)
at Object.get [as valid] (index.js:10)
at StrapTable.eval [as isAppVerValid] (userOverview.jsx:409)

How

Current Behavior

crash

Steps to Reproduce

This only happens when I run webpack to build a deployment package (mode doesn't matter, happens in both production and development modes)

Expected Behavior

work like 5.x

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