sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.8k stars 105 forks source link

ow can't work with "next" framework. #182

Closed drortirosh closed 3 years ago

drortirosh commented 4 years ago

To Reproduce:

See error:

Module not found: Can't resolve 'fs' in '/Users/dror/Downloads/tnext/node_modules/ow/dist/source'

Root cause:

Internally, "ow" uses "fs" module when used in "node" environment. It was supposed to be disabled when used in a browser environment, but it doesn't work with Next. strangely, it does work correctly when added into plain "react" app (e.g. created with yarn create react-app)

sindresorhus commented 4 years ago

I would open an issue on Next.js. There's not much we can do here. We need fs in Node.js and we have correctly excluded it for browsers per convention: https://github.com/sindresorhus/ow/blob/b2285d0d4fe59def762bd989cab067d8d9b66eab/package.json#L80-L82