Closed lukmccall closed 5 months ago
I actually reverted this change a while ago due to it causing import errors for some people https://github.com/alexbrazier/react-native-network-logger/pull/17 https://github.com/alexbrazier/react-native-network-logger/issues/16
I'm assuming this will bring back those issues again?
Hello @alexbrazier, thank you for your response! AFAIK, the bundler should load the compiled JavaScript file instead of the source folder. In the linked issue, it seems like Metro is attempting to use the .ts
file for some unknown reason. I'm not sure if your package was built before it was published four years ago. Still, currently, you are publishing compiled JavaScript files that shouldn't contain any information regarding exported types, at least not in .js
files.
Exporting a type without annotation (not using
export type
) can cause some unexpected bugs. For example, when using tools likernx-kit
withtree shaking
enabled, the project may fail to compile because it tries to import a non-existing type. During thetree shaking
step, those types are removed, so using correct export annotations can help avoid these issues.