1

how can i find a replacement for fs?

i am using the itunes APN from npm (npm install apn) but it uses the fs module. I spend many hours on research and some suggested i had this to my webpack config

node: { 'fs': empty }

this prevents any errors but it obviously breaks the code so as far as i am concerned is not a solution at all.

I tried using fs-extra but this requires graceful-fs which in turns requires again the good old 'fs' module. So we are going in circles. How can i solve this please?

The Architect
  • 313
  • 2
  • 10
  • 2
    Sounds like you're trying to use `apn` inside a browser, which isn't going to work anyway. – robertklep Jun 22 '17 at 15:07
  • ohhhhhhhhh, it all makes sense now, i get why they said to ignore fs. Thank you!!!! Can you maybe tell me how i can find a module that i need to build my itunes notification server backend? – The Architect Jun 22 '17 at 15:15
  • Possible duplicate of [How to use child\_process in webpack](https://stackoverflow.com/questions/43741708/how-to-use-child-process-in-webpack) – peteb Jun 22 '17 at 16:27
  • @TheArchitect you can use `apn` in the backend if you like, but if you're trying to build a backend bundle, the issue may be that you're not setting the correct [target](https://webpack.js.org/configuration/target/) – robertklep Jun 22 '17 at 18:03
  • Thank you both. Robert, can i pm you at all? I would be infinitely grateful for a few pointers. – The Architect Jun 23 '17 at 01:38

0 Answers0