Skip to content

Upgrading @elastic/eui from 40.1.0 to 41+, cannot find module ../../../test #5605

Closed

Description

@sheldonimrsv

Hi, when updating @elastic/eui from 40.1.0 to 41.0.0 up to the current 46, have the following error:

Creating an optimized production build...
Failed to compile.
/home/node/node_modules/@elastic/eui/es/components/datagrid/body/data_grid_body.js
Cannot find module: '../../../test'. Make sure this package is installed.
You can install this package by running: yarn add ../../../test.

Suspect the error is triggered by line 56 of data_grid_body.js:

import { IS_JEST_ENVIRONMENT } from '../../test';

Any advice is appreciated :)

Activity

  1. chandlerprall commented on Feb 5, 2022

    @chandlerprall
    Contributor

    Thanks for reporting! I'm unable to reproduce this in a new Create React App with v46.2.0, and we use the published npm package in internal projects here without issue. I also verified that the es and lib directories contain test/index.js.

    I'm not familiar with the exact error message you're seeing, but a quick google search indicates it may be coming from a github action? Can you describe your setup and what command(s) causes the error?

  2. added
    ⚠️ needs validation
    on Feb 5, 2022
  3. sheldonimrsv commented on Feb 7, 2022

    @sheldonimrsv
    Author

    This error occurs during building: docker compose build ...
    The details I can provide are very limited but, I can say we are using a docker container (Node 16 Alpine 3.14). We were upgrading from 37.3.0 to 46.2.0; starting with yarn upgrade @elastic/[email protected]. Since that failed, we gradually upgraded from 37.3.0 to 40.1.0 and noticed the error occurs at 41.0.0. We have been reviewing the package.json for any version bumps that might be required.
    This is a local build and does not involve a GitHub repo.
    Looking at the summary CHANGELOG for 41.0.0, did not notice any change in dependencies however, were there any packages, undocumented, that needed to be bumped up a version?
    P.S. We have no jest tests

  4. sheldonimrsv commented on Feb 10, 2022

    @sheldonimrsv
    Author

    Our .yarnclean deletes all test directories in node_modules. Since the check for IS_JEST_ENVIRONMENT is looking for a test directory, this has been commented out; for now. When you release a patch, we can delete all test directories again.

  5. chandlerprall commented on Feb 11, 2022

    @chandlerprall
    Contributor

    Aha! Thanks for the extra info, that makes a lot of sense. I'll take a look at resolving this next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

⚠️ needs validation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions