Skip to content

Unable to webpack compile after installing module #676

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

Closed
duhmojo opened this issue Oct 19, 2021 · 6 comments
Closed

Unable to webpack compile after installing module #676

duhmojo opened this issue Oct 19, 2021 · 6 comments
Labels

Comments

@duhmojo
Copy link

duhmojo commented Oct 19, 2021

Hi. I haven't found any info or tips on my issue so I'm turning to you to see if this is a simple issue on my part. After I installed your typeahead module my webpack compile started to fail with the following:

ERROR in ./node_modules/react-bootstrap-typeahead/es/propTypes.js
Module not found: Error: Can't resolve './types' in '/home/duh/Development/verity/frontend/node_modules/react-bootstrap-typeahead/es'
 @ ./node_modules/react-bootstrap-typeahead/es/propTypes.js 4:0-31 18:52-56
 @ ./node_modules/react-bootstrap-typeahead/es/components/ClearButton.js
 @ ./node_modules/react-bootstrap-typeahead/es/index.js
 @ ./src/_complianceServicesProfiles/Profiles.jsx
 @ ./src/_complianceServicesProfiles/ComplianceServicesProfiles.jsx
 @ ./src/IrmPage/IrmPage.jsx
 @ ./src/IrmPage/index.js
 @ ./src/App/NavPage.jsx
 @ ./src/App/App.jsx
 @ ./src/App/index.js
 @ ./src/index.jsx

In my Component I just imported the css and module as instructed:

...
import 'react-bootstrap-typeahead/css/Typeahead.css';
import { Typeahead } from 'react-bootstrap-typeahead';

I'm not sure if the problem is related to Typeahead looking for Size from './types' while under /es/ as it looks like the types are under a directory back. .e.g there is no ./es/types. I'm unfamiliar with this detail and not sure if its something I should be configuring in Webpack. Any tips would be helpful as I'm unable to try your module at all right now.

For versions I'm using:

  • "react": "16.13.1",
  • "react-bootstrap": "^1.6.4",
  • "react-bootstrap-typeahead": "^6.0.0-alpha.2",
    ...
  • "html-webpack-plugin": "4.3.0",
  • "url-loader": "4.1.0",
  • "webpack": "4.43.0",
  • "webpack-cli": "3.3.12",
  • "webpack-dev-server": "3.11.0"

Thank you.

@duhmojo duhmojo added the bug label Oct 19, 2021
@ericgio
Copy link
Owner

ericgio commented Oct 19, 2021

Hey @duhmojo thanks for the report! There is a types.ts file in the source files. I instructed babel to ignore it when it transpiles the cjs and es modules, which is why you don't see it. However, that file contains a Size enum that is being called in propTypes.js and a few other places, which is triggering the error. I'll publish a new version with a fix.

ericgio added a commit that referenced this issue Oct 20, 2021
@ericgio
Copy link
Owner

ericgio commented Oct 20, 2021

This should be resolved in v6.0.0-alpha.3

@ericgio ericgio closed this as completed Oct 20, 2021
@harrylepotter-win
Copy link

Hey @ericgio - for some reason or other i still appear to be having this issue in 6.0.0-alpha.4

@ericgio
Copy link
Owner

ericgio commented Jan 7, 2022

@harrylepotter-win: Thanks for the report. I caused the same issue again with a change in v6.0.0-alpha.5 🤦

@ericgio
Copy link
Owner

ericgio commented Jan 7, 2022

Should be fixed in v6.0.0-alpha.6

@harrylepotter-win
Copy link

@ericgio many thanks! (...and thanks for the awesome component!)

ericgio added a commit that referenced this issue Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants