Skip to content

@component: Bad character escape sequence error on windows 10 #43

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

Closed
fhenderson opened this issue Dec 5, 2019 · 4 comments · Fixed by #46
Closed

@component: Bad character escape sequence error on windows 10 #43

fhenderson opened this issue Dec 5, 2019 · 4 comments · Fixed by #46

Comments

@fhenderson
Copy link

When I add the tag @component in a React functional component description header and I ran the documentation generation I am getting the following error. Any idea of how the generated PATH got inserted \ in it

D:\git\nirvana\ui>yarn docs
yarn run v1.17.3
$ jsdoc -c jsdoc.conf.json
Generating entry file for "components" plugin
Bundling components
running: parcel build docs/entry.js --out-dir docs/build
×  D:\git\nirvana\ui\docs\entry.js:12:54: Bad character escape sequence (12:54)
  10 |
  11 |
> 12 |       import ReactWrapper from '../../D:\git\nirvana\ui\node_modules\better-docs/lib/react-wrapper.js';
     |                                                      ^
  13 |
  14 |       window.React = React;
  15 |

D:\git\nirvana\ui\node_modules\better-docs\bundler.js:83
    throw error
    ^

Error: Command failed: parcel build docs/entry.js --out-dir docs/build
    at checkExecSyncError (child_process.js:629:11)
    at execSync (child_process.js:666:13)
    at bundle (D:\git\nirvana\ui\node_modules\better-docs\bundler.js:78:5)
    at Object.exports.publish (D:\git\nirvana\ui\node_modules\better-docs\publish.js:655:5)
    at Object.module.exports.cli.generateDocs (D:\git\nirvana\ui\node_modules\jsdoc\cli.js:441:39)
    at Object.module.exports.cli.processParseResults (D:\git\nirvana\ui\node_modules\jsdoc\cli.js:392:24)
    at module.exports.cli.main (D:\git\nirvana\ui\node_modules\jsdoc\cli.js:235:18)
    at Object.module.exports.cli.runCommand.cb [as runCommand] (D:\git\nirvana\ui\node_modules\jsdoc\cli.js:186:9)
    at D:\git\nirvana\ui\node_modules\jsdoc\jsdoc.js:93:9
    at Object.<anonymous> (D:\git\nirvana\ui\node_modules\jsdoc\jsdoc.js:94:3)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
DoubleU23 added a commit to DoubleU23/better-docs that referenced this issue Dec 7, 2019
DoubleU23 added a commit to DoubleU23/better-docs that referenced this issue Dec 7, 2019
DoubleU23 added a commit to DoubleU23/better-docs that referenced this issue Dec 7, 2019
@Korhm
Copy link

Korhm commented Feb 18, 2020

I can confirm that fix from DoubleU23 is working.

@apolopena
Copy link

I still get the issue using "better-docs": "1.4.7" on Windows 10. Looks like the pathing to the component is erroneous. Here is the interesting part of the stack trace:

Bundling components
running: parcel build docs\/entry.js --out-dir docs\/build
×  C:\Users\penav\visual-studio-projects\apolopenadotcom\docs\entry.js:25:25: Cannot resolve dependency '../../C:Userspenav
                                                                                                                           isual-studio-projectsapolopenadotcomsrccomponentsSmartCaption.js' at 'C:\Users\penav\visual-st
udio-projects\C:Userspenav
                          isual-studio-projectsapolopenadotcomsrccomponentsSmartCaption.js'
  23 |     import './styles/iframe.css';
  24 |
> 25 |   import Component0 from '../../C:\Users\penav\visual-studio-projects\apolopenadotcom\src\components\SmartCaption.js';
     |                         ^
  26 | reactComponents['SmartCaption'] = Component0;

C:\Users\penav\visual-studio-projects\apolopenadotcom\node_modules\better-docs\bundler.js:83
    throw error
    ^

Error: Command failed: parcel build docs\/entry.js --out-dir docs\/build
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at bundle (C:\Users\penav\visual-studio-projects\apolopenadotcom\node_modules\better-docs\bundler.js:78:5)

@apolopena
Copy link

The fix from DoubleU23 has not been implemented. Would be nice to get this in.

@maamve
Copy link

maamve commented Apr 27, 2020

Please we need this!

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

Successfully merging a pull request may close this issue.

4 participants