Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error:- macOS #36

Open
ajaydexati opened this issue Jun 11, 2020 · 4 comments
Open

Build Error:- macOS #36

ajaydexati opened this issue Jun 11, 2020 · 4 comments

Comments

@ajaydexati
Copy link

ajaydexati commented Jun 11, 2020

After modifying package.json according to answers and able to run the yarn watch.
But when building the project using yarn build, then running the by clicking index.html and going to camera.html its show : Invalid regular expression: range out of order in character class in camera.js

@h4rk8s
Copy link

h4rk8s commented Jun 17, 2020

`diff --git a/package.json b/package.json
index 2e6050b..2f82680 100644
--- a/package.json
+++ b/package.json
@@ -15,11 +15,11 @@
"@tensorflow/tfjs-converter": "^1.7.0",
"@tensorflow/tfjs-core": "^1.7.0",
"face-api.js": "^0.22.1",

  • "paper": "file:third_party/paper",
  • "paper": "^0.12.1",
    "stats.js": "^0.17.0"
    },
    "scripts": {
  • "watch": "cross-env NODE_ENV=development parcel index.html --no-hmr --open ",
  • "watch": "cross-env NODE_ENV=development parcel index.html --no-hmr --open --no-source-maps",
    "build": "cross-env NODE_ENV=production parcel build index.html --public-url ./",
    "build-camera": "cross-env NODE_ENV=production parcel build camera.html --public-url ./",
    "lint": "eslint .",
    `

then fixed!

@ajaydexati
Copy link
Author

ajaydexati commented Jun 17, 2020

on running yarn build after the above changes.
Environment - macOS and above error i mentioned is for mac os only
$yarn build

pose-animator-master/node_modules/paper/dist/paper-full.js:17258:12: Unterminated string constant (17258:12)
  17256 |                       }
  17257 |                       if (/^(inline|both)$/.test(sourceMaps)) {
> 17258 |                               code += "\n
        |                                      ^
  17259 |                                               + self.btoa(unescape(encodeURIComponent(
  17260 |                                                       JSON.stringify(map))));
  17261 |                       }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@ajaydexati ajaydexati changed the title Build Error Build Error:- macOS Jun 17, 2020
@matthewtoast
Copy link

My workaround was to hand-edit node_modules/paper/dist/paper-full.js. This is offending block:

			if (/^(inline|both)$/.test(sourceMaps)) {
				code += "\n//# sourceMappingURL=data:application/json;base64,"
						+ self.btoa(unescape(encodeURIComponent(
							JSON.stringify(map))));
			}
			code += "\n//# sourceURL=" + (url || 'paperscript');

I changed it to:

			if (/^(inline|both)$/.test(sourceMaps)) {
				code += "\n\/\/# sourceMappingURL=data:application/json;base64," + self.btoa(unescape(encodeURIComponent( JSON.stringify(map))));
			}
			code += "\n\/\/# sourceURL=" + (url || 'paperscript');

And then everything worked.

@pansy199211
Copy link

Why a public project have this kind of error? T T....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants