GeekyAnts / GeekyAnts/NativeBase

HookWebpackError while running with NextJS starter using npm

Open
#4,466 13 comments 2 reactions 0 assignees View on GitHub
stale v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug
Running a NextJS app with the nativebase starter using `npm` gives the following error: `Internal Server Error` on the Browser and `HookWebpackError: Cannot read property 'replace' of undefined` on the Terminal. The app runs fine using `yarn`.

## To Reproduce
Steps to reproduce the behaviour:

1. create a Project with nativebase and NextJS using the command: ` npx create-next-app -example https://github.com/GeekyAnts/nativebase-templates/tree/master/nextjs-with-native-base`
2. Give your project a name when prompted
3. After installation run the command `npm run dev`
4. The Browser shows `Internal Server Error` while the CLI shows `HookWebpackError: Cannot read property 'replace' of undefined`

## Expected behaviour
The App should run properly on the browser showing the homepage.

## Screenshots
![Error on MacOS](https://i.ibb.co/qRm6NFT/Screenshot-2021-12-28-at-2-35-46-PM.png)

## Platform

- NativeBase version 3.2.2
- Device: MacBook Pro (16-inch, i7, 2019)
- OS: MacOS Big Sur 11.4
- Browser: Chrome
- Browser version: 96.0.4664.110
- node : 14.17.5
- npm: 6.14.14

## Additional information

1. The project runs successfully using yarn
2. If `yarn` is installed on the system, `yarn` takes over the installation even when npx command is used for installation and therefore it works fine
3. After installation using `yarn`, npm commands run perfectly
4. Deleting the `yarn.lock` and `node-modules` and reinstalling the packages gives the error described above
3. The issue seems to be coming from `@expo/next-adapter` package

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.