"fs" dependency was not found?
See original GitHub issueI’m trying to 1.0.0-alpha.10 in Gatsby but I keep getting this error
⠀
* fs in ./node_modules/reduce-css-calc/dist/parser.js
⠀
To install it, you can run: npm install --save fs
× 「wdm」:
ERROR in ./node_modules/reduce-css-calc/dist/parser.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\risto\Sites\Personal\can-i-kick-it\node_modules\reduce-css-calc\dist'
@ ./node_modules/reduce-css-calc/dist/parser.js 731:17-30
@ ./node_modules/reduce-css-calc/dist/index.js
@ ./node_modules/tailwind.macro/node_modules/tailwindcss/lib/util/negateValue.js
@ ./node_modules/tailwind.macro/node_modules/tailwindcss/lib/util/resolveConfig.js
@ ./node_modules/tailwind.macro/utils.umd.js
@ ./src/pages/index.js
@ ./.cache/sync-requires.js
@ ./.cache/app.js
@ multi ./node_modules/event-source-polyfill/src/eventsource.js (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false C://Users//risto//Sites//Personal//can-i-kick-it//.cache//app
i 「wdm」: Failed to compile.
My code is
import styled from "styled-components"
import tw from "tailwind.macro"
const Button = styled.button`
${tw`bg-blue-100`}
`
babel-plugin-macros.config.js
module.exports = {
tailwind: {
styled: "styled-components/macro",
},
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10
Top Results From Across the Web
fs dependency not found · Issue #11 - GitHub
When I run npm run dev I'm getting the following error: This dependency was not found: fs in ./node_modules/@nuxtjs/dotenv/dist/index.js. To ...
Read more >getting the following error This dependency was not found: FS
When I run npm run dev. I am getting the following error. ERROR Failed to compile with 3 errors 22:07:39. This dependency was...
Read more >node.js - How to resolve the "Module not found: Error: Can't ...
I've come across several packages I've tried to install via npm and have run into the Module not found: Error: Can't resolve 'fs'...
Read more >module not found: error: can't resolve 'fs' - You.com
Module not found: Error: Can't resolve 'fs' is a common error that can occur when working with certain libraries or frameworks. It indicates...
Read more >Module not found: Can't resolve 'fs' error [Solved] | bobbyhadz
To solve the error, set the browser.fs property to false in your package.json file. module not found error cant resolve fs. The first...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This appears to be due to Tailwind CSS’s use of
reduce-css-calc
starting with Tailwind^1.1.0
, which apparently depends on it being run via Node.https://www.gitmemory.com/issue/TVke/react-native-tailwindcss/7/523364996
@zlokomatic 's solution above works, which to clarify means adding this to your
gatsby-node.js
:The only other thing that could help is if
tailwindcss
was a peer dependency ofbabel-plugin-tailwind-components
so that we could control the version that ends up getting used.I added
to my webpack config to resolve the error