Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v9.1.7 contains a module bug #2726

Closed
kai-dorschner-twinsity opened this issue Mar 29, 2023 · 10 comments
Closed

Release v9.1.7 contains a module bug #2726

kai-dorschner-twinsity opened this issue Mar 29, 2023 · 10 comments

Comments

@kai-dorschner-twinsity
Copy link

  • components: build
  • reactstrap version #9.1.7
  • import method "esm/index.js"
  • react version #18.2.0
  • bootstrap version #5.2.3

What is happening?

After upgrading the parcel bundler cannot find the folder esm/ which is reference in the package.json like so "module": "esm/index.js",

Error message in console

Server running at http://localhost:8080
🚨 Build failed.

@parcel/core: Failed to resolve 'reactstrap' from './src/apps/project/pages/NotFound.tsx'

  C:\Users\User\project\src\apps\currentApp\pages\NotFound.tsx:4:24
    3 | import { Link } from 'react-router-dom';
  > 4 | import { Button } from 'reactstrap';
  >   |                        ^^^^^^^^^^^^

@parcel/resolver-default: Could not load './esm/index.js' from module 'reactstrap' found in package.json#module

  C:\Users\User\project\node_modules\reactstrap\package.json:7:13
    6 |   "main": "lib/index.js",
  > 7 |   "module": "esm/index.js",
  >   |             ^^^^^^^^^^^^^^ './esm/index.js' does not exist, did you mean './lib/index.js'?'
    8 |   "types": "types/index.d.ts",
    9 |   "sideEffects": false,

@aldwyn
Copy link

aldwyn commented Mar 29, 2023

This must be related. The following error is also in version 9.1.7:

./node_modules/reactstrap/lib/index.js:1:0
Module not found: Can't resolve './Container'

Import trace for requested module:
./components/Footer.tsx
./components/Layout.tsx
./pages/_app.tsx

For now, it's better to use version 9.1.6.

@donyvarkeywmp
Copy link

donyvarkeywmp commented Mar 29, 2023

I'm also facing this error.
export 'Row' (imported as 'Row') was not found in 'reactstrap' (module has no exports)

Fallback to v9.1.6 for now worked.

@tatasaikumar
Copy link

Getting this issue in 9.1.7 version,

export 'Modal' (imported as 'Modal') was not found in 'reactstrap' (module has no exports)
export 'ModalHeader' (imported as 'ModalHeader') was not found in 'reactstrap' (module has no exports)
export 'ModalBody' (imported as 'ModalBody') was not found in 'reactstrap' (module has no exports)
export 'ModalFooter' (imported as 'ModalFooter') was not found in 'reactstrap' (module has no exports)

@donyvarkeywmp
Copy link

Getting this issue in 9.1.7 version,

export 'Modal' (imported as 'Modal') was not found in 'reactstrap' (module has no exports) export 'ModalHeader' (imported as 'ModalHeader') was not found in 'reactstrap' (module has no exports) export 'ModalBody' (imported as 'ModalBody') was not found in 'reactstrap' (module has no exports) export 'ModalFooter' (imported as 'ModalFooter') was not found in 'reactstrap' (module has no exports)

Fallback to version 9.1.6

@kai-dorschner-twinsity
Copy link
Author

kai-dorschner-twinsity commented Mar 29, 2023

The issue is probably easily fixed by the developers by just calling npm run build:esm, which they might have forgotten on this release.

Reference:

"build:esm": "babel src --out-dir esm --config-file ./babel.esm.config.cjs --extensions '.js,.ts,.tsx'",

Edit

This is probably the commit that caused the error: fa46b94

@illiteratewriter
Copy link
Member

@kai-dorschner-twinsity the issue should be fixed with #2727. As you said the issue is in #2708; but the issue is you can choose which files to be published in the npm package, and the folders esm and lib was not included in the files to be published. You can read more here.

@yachtsman-dev
Copy link

yachtsman-dev commented Mar 29, 2023

When i upgrade to latest version start getting following error while creating build

Module not found: Error: Can't resolve './Container' in 'project_source/node_modules/reactstrap/lib'
Module not found: Error: Can't resolve './Col' in 'project_source/node_modules/reactstrap/lib'
Module not found: Error: Can't resolve './Row' in 'project_source/node_modules/reactstrap/lib'

Then after try to downgrade to v9.1.6 but start facing same issue, then i also try to downgrade up to v9.1.0 but still facing same issue. I have completely remove node_modules and package-lock.json file and tried but not working at all. i am using below vrsions.
react 18.2.0
react-dom 18.2.0
bootstrap 5.2.3
node 16.14.0

@yachtsman-dev
Copy link

For temporary fix i have removed "reactstrap": "^9.1.6", and set "reactstrap": "9.1.6", in package.json file and its working fine for me.

@kai-dorschner-twinsity
Copy link
Author

kai-dorschner-twinsity commented Mar 29, 2023

Closing when #2725 is done

Edit:
Everything works fine with v9.1.8 now

@illiteratewriter
Copy link
Member

@kai-dorschner-twinsity thank you for the detailed bug report. Made fixing it easier. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants