Cache / Babel issue on building
See original GitHub issuehttps://www.npmjs.com/package/easy-import and my .babelrc
file looks as follows:
{
"presets": ["react-native"],
"plugins": [
"easy-import"
]
}
I use the above package in my projects (think of it as a lighter-weight facebook/node-haste
.)
After running the following command:
npm run start -- --reset-cache & react-native run-ios
my build starts as expected, and things work normally.
When I create a component such as the following:
// @provides Component
import React from 'react';
export default class Component extends React.Component {
}
and try to include it elsewhere in my code:
import Component from 'Component`
I get the following common error:
Unable to resolve module
I clear all the caches, follow the instructions and then randomly and occasionally things work. This is to say that I do have components working with the easy-import
module, they just sometimes get ignored / can’t invalidate a cache that searches the dependency map.
How can we ensure that the babel plugins are being run on every save / live reload? I actually haven’t found a working solution to force a full compile every time yet.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
I used at least 3 babel plugins in the past that had the same problem with react-native, the last one is babel-plugin-module-resolver. Does anyone know if this caching issue can be fixed?
I don’t think this issue can be closed as
answered
. Not being able to usenpm
modules properly in your build cycle is a huge problem. Just because there are alternatives, doesn’t mean it isn’t an issue.@mkonicek @grabbou