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

webpack build fails #437

Open
sacru2red opened this issue Jan 3, 2025 · 2 comments
Open

webpack build fails #437

sacru2red opened this issue Jan 3, 2025 · 2 comments
Labels
bug Something isn't working needs repro Needs reproducible example stale

Comments

@sacru2red
Copy link

sacru2red commented Jan 3, 2025

Current behaviour

webpack build fails

18.x Ok
22.02 Ok
22.10 Ok
22.15 Ok
22.18 Ok
22.19 Ok
22.20 Not ok

ref https://github.com/web-ridge/react-native-paper-dates/releases/tag/v0.22.20

Expected behaviour

webpack build success

How to reproduce?

sorry. Issues are provided first without enough time to construct a minimal reproducible repo.

If there is a comment saying that it is not confirmed, we will try to spend more time.

error example 1 (process not in babel, but before 0.22.19 working)
webpack throws error

ERROR in ../../node_modules/react-native-paper-dates/lib/module/index.js 22:0-50
Module not found: Error: Can't resolve './translations/nl' in 'projects\node_modules\react-native-paper-dates\lib\module'
Did you mean 'nl.js'?

error example 2 (process in babel)
no build error, but runtime error thorows

index.js:482 Uncaught ReferenceError: require is not defined
    at ../../node_modules/react-native-paper-dates/lib/module/index.js (index.js:482:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./src/common/DatePicker/PaperDatePickerInput.tsx (PaperDatePickerInput.tsx:2:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./src/common/index.ts (index.ts:1:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./src/MainDrawer/FooScreen/index.tsx (index.tsx:16:1)

Preview

What have you tried so far?

Your Environment

software version
ios x
android x
react-native 0.76.5
react-native-paper ^5.12.5
node 20.18.1
npm or yarn 10.9.2
expo sdk x.x.x
@sacru2red sacru2red added the bug Something isn't working label Jan 3, 2025
@RichardLindhout
Copy link
Member

Maybe you are transpiling our repo? Our repo has web support and already build files for webpack.

Our package.json ->

  "main": "lib/commonjs/index",
  "module": "lib/module/index",
  "types": "lib/typescript/index.d.ts",
  "react-native": "src/index",
  "source": "src/index",

What is your webpack config? Have you recently upgraded webpack or something? I did not have problems on webpack or metro web bundler with the react-native-paper-dates package

@iM-GeeKy iM-GeeKy added needs repro Needs reproducible example stale labels Jan 15, 2025
Copy link
Contributor

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs reproducible example stale
Projects
None yet
Development

No branches or pull requests

3 participants