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

Tooling doesn't work on Windows #169

Open
johnathanDOS opened this issue May 12, 2020 · 0 comments
Open

Tooling doesn't work on Windows #169

johnathanDOS opened this issue May 12, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@johnathanDOS
Copy link
Collaborator

johnathanDOS commented May 12, 2020

Doing npm start on a Windows machine returns an error like this:

> node ./scripts/server.js

[metalsmith-watch] ✓ Live reload server started on port: 35729
TypeError: Cannot read property 'split' of undefined
    at createInPageIndexes (C:\Path\Documentation\node_modules\metalsmith-lunr\lib\index.js:66:49)
    at indexDocs (C:\Path\Documentation\node_modules\metalsmith-lunr\lib\index.js:43:27)
    at Ware.<anonymous> (C:\Path\Documentation\node_modules\metalsmith-lunr\lib\index.js:11:5)
    at Ware.<anonymous> (C:\Path\Documentation\node_modules\metalsmith\node_modules\wrap-fn\index.js:45:19)
    at next (C:\Path\Documentation\node_modules\metalsmith\node_modules\ware\lib\index.js:85:20)
    at C:\Path\Documentation\node_modules\metalsmith\node_modules\wrap-fn\index.js:121:18
    at C:\Path\mistydoc\Documentation\node_modules\metalsmith-autotoc\index.js:142:7
    at done (C:Path\Documentation\node_modules\metalsmith-autotoc\node_modules\async\lib\async.js:132:19)
    at C:\Path\Documentation\node_modules\metalsmith-autotoc\node_modules\async\lib\async.js:32:16
    at C:\Path\Documentation\node_modules\metalsmith-autotoc\index.js:139:9
    at C:\Path\Documentation\node_modules\metalsmith-autotoc\node_modules\async\lib\async.js:122:13
    at _each (C:\Path\Documentation\node_modules\metalsmith-autotoc\node_modules\async\lib\async.js:46:13)
    at Object.async.each (C:\Path\Documentation\node_modules\metalsmith-autotoc\node_modules\async\lib\async.js:121:9)
    at Ware.<anonymous> (C:\Path\Documentation\node_modules\metalsmith-autotoc\index.js:116:11)
    at Ware.<anonymous> (C:\Path\Documentation\node_modules\metalsmith\node_modules\wrap-fn\index.js:45:19)
    at Immediate.next (C:\Path\Documentation\node_modules\metalsmith\node_modules\ware\lib\index.js:85:20)
    at Immediate._onImmediate (C:\Path\Documentation\node_modules\metalsmith\node_modules\wrap-fn\index.js:121:18)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5) 'TypeError: Cannot read property \'split\' of undefined\n    at createInPageIndexes (C:\\Path\\Documentation\\node_modules\\metalsmith-lunr\\lib\\index.js:66:49)\n    at indexDocs (C:\\Path\\Documentation\\node_modules\\metalsmith-lunr\\lib\\index.js:43:27)\n    at Ware.<anonymous> (C:\\Path\\Documentation\\node_modules\\metalsmith-lunr\\lib\\index.js:11:5)\n    at Ware.<anonymous> (C:\\Path\\Documentation\\node_modules\\metalsmith\\node_modules\\wrap-fn\\index.js:45:19)\n    at next (C:\\Path\\Documentation\\node_modules\\metalsmith\\node_modules\\ware\\lib\\index.js:85:20)\n    at C:\\Path\\Documentation\\node_modules\\metalsmith\\node_modules\\wrap-fn\\index.js:121:18\n    at C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\index.js:142:7\n    at done (C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\node_modules\\async\\lib\\async.js:132:19)\n    at C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\node_modules\\async\\lib\\async.js:32:16\n    at C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\index.js:139:9\n    at C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\node_modules\\async\\lib\\async.js:122:13\n    at _each (C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\node_modules\\async\\lib\\async.js:46:13)\n    at Object.async.each (C:\\Path\Documentation\\node_modules\\metalsmith-autotoc\\node_modules\\async\\lib\\async.js:121:9)\n    at Ware.<anonymous> (C:\\Path\\Documentation\\node_modules\\metalsmith-autotoc\\index.js:116:11)\n    at Ware.<anonymous> (C:\\Path\\Documentation\\node_modules\\metalsmith\\node_modules\\wrap-fn\\index.js:45:19)\n    at Immediate.next (C:\\Path\\Documentation\\node_modules\\metalsmith\\node_modules\\ware\\lib\\index.js:85:20)\n    at Immediate._onImmediate (C:\\Path\\Documentation\\node_modules\\metalsmith\\node_modules\\wrap-fn\\index.js:121:18)\n    at runCallback (timers.js:794:20)\n    at tryOnImmediate (timers.js:752:5)\n    at processImmediate [as _immediateCallback] (timers.js:729:5)'

I found a related issue in the Particle docs repo (the Misty docs are based on their toolchain): particle-iot/docs#384

This comment is from one of the Particle engineers:

Sorry to say this isn't likely to be a simple fix. I don't think the Metalsmith static site generator and all the plugins we use are well tested on Windows."

The issue appears to be related to the metalsmith-lunr and/or lunr.js dependencies. If I remove references to these libraries from the metalsmith.js build script, then npm start works, and the site builds...but, it builds incorrectly, because we actually use those dependencies to build out the search functionality. Removing them screws up the build process and breaks search and other parts of the site.

Unfortunately, removing these dependencies is not a guaranteed fix. It appears that the Particle + Metalsmith toolchain isn't comprehensively tested on Windows to begin with, and there may be other problems that come up once this issue is resolved.

@johnathanDOS johnathanDOS added the bug Something isn't working label May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant