Skip to content
This repository was archived by the owner on Apr 11, 2022. It is now read-only.
This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Documentation on How to Ignore Files/Directories with Phonegap Serve and Create-React-App #806

Open

Description

@tamb

PhoneGap CLI, node & npm versions

Phonegap 8.2.2
Node 11.7.0
npm 6.5.0

Expected Behaviour

Be able to ignore inner node_modules directories or specific files, and reload on a save of index.html

Actual Behaviour

There is no documentation on how to ignore certain files or directories from the watch. I'm expecting some sort of flag or config file. Hits a watch limit on files and the phonegap app shuts down.

Steps to Reproduce

run an npm init and install create-react-app in www directory. Run server for react on port 3005. Run phonegap serve within your app root directory. You will hit a file watch limit error because phonegap is watching the entirety of node_modules and the changes that occur with create-react-apps reloading.
phonegap serve lingers for a while... then errors

Sample Code that illustrates the problem

www
_ node_modules
_ create react app scaffold

Error messages

[phonegap] [console.warn] Content Security Policy has been modified to be: <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval' * ws:;style-src 'self' 'unsafe-inline' data: blob:;media-src *;img-src 'self' data: content: *;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
[phonegap] [console.warn] Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src * 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
[phonegap] [console.warn] Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src * 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
There was an unhandled exception within phonegap-cli! If you would like to help the PhoneGap project, please file the following details over at https://github.com/phonegap/phonegap-cli/issues
Error: EMFILE: too many open files, open 'C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\res\middleware\autoreload.js'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\lib\util\scripts-to-inject.js:43:35
    at Array.forEach (<anonymous>)
    at Object.getScripts (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\lib\util\scripts-to-inject.js:41:17)
    at new module.exports (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\lib\util\injector-transform.js:30:32)
    at EventEmitter.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\lib\middleware\zip.js:85:49)
    at emitThree (events.js:136:13)
    at EventEmitter.emit (events.js:217:7)
    at fn (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\walkdir\walkdir.js:93:19)
C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\conf\index.js:128
                        throw err;
                        ^

Error: EMFILE: too many open files, open 'C:\Users\Admin\AppData\Local\insight-nodejs\Config\insight-phonegap.json'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Conf.get store [as store] (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\conf\index.js:108:18)
    at Conf.get (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\conf\index.js:47:27)
    at Insight.get optOut [as optOut] (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\node_modules\insight\lib\index.js:52:22)
    at Function.hasOptedOut (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\lib\cli\analytics.js:160:20)
    at Function.trackEvent (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\lib\cli\analytics.js:218:24)
    at process.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js:21:15)
    at emitOne (events.js:116:13)
    at process.emit (events.js:211:7)

note:

I would be willing to settle for adjusting watch limits (running in Ubuntu 18).
But I think an ignore feature is needed.
react server is on a different port than phonegap

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions