sahiljain112 / html-template-generator

A template generator built for Atom text editor
MIT License
3 stars 2 forks source link

Uncaught The "path" argument must be of type string. Received type undefined #9

Open prblackburn opened 5 years ago

prblackburn commented 5 years ago

Steps to reproduce:

  1. New Window
  2. Packages > HTML Template Generator > Quick Generate HTML Template

Atom: 1.40.1 x64 Electron: 3.1.10 OS: Mac OS X 10.14.6 Thrown From: html-template-generator package 0.3.0

Stack Trace

Uncaught The "path" argument must be of type string. Received type undefined

At path.js:39

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.join (path.js:1157:7)
    at HtmlTemplateGeneratorView.generateQuickTemplate (/packages/html-template-generator/lib/html-template-generator-view.js:145:27)
    at HTMLElement.htmlTemplateGeneratorQuickGenerate (/packages/html-template-generator/lib/html-template-generator.js:24:74)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349123)
    at CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:347598)
    at AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:1:718718)
    at EventEmitter.t (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:1:726641)
    at EventEmitter.emit (events.js:182:13)

Commands

  2x -1:29.8.0 core:backspace (input.hidden-input)
     -1:28.8.0 core:confirm (input.hidden-input)
  3x -1:24.6.0 core:backspace (input.hidden-input)
     -1:02.8.0 core:select-all (input.hidden-input)
     -1:02.5.0 core:backspace (input.hidden-input)
     -0:30.6.0 application:new-file (input.hidden-input)
     -0:23.6.0 core:backspace (input.hidden-input)
     -0:19.5.0 spell-check:correct-misspelling (input.hidden-input)
     -0:18.1.0 core:select-all (input.hidden-input)
  2x -0:17.9.0 core:backspace (input.hidden-input)
     -0:08.8.0 html-template-generator:quick-generate (input.hidden-input)
     -0:07.0 editor:consolidate-selections (input.hidden-input)
     -0:07.0 core:cancel (input.hidden-input)
     -0:06.4.0 editor:consolidate-selections (input.hidden-input)
     -0:06.4.0 core:cancel (input.hidden-input)
     -0:02.5.0 html-template-generator:quick-generate (input.hidden-input)

Non-Core Packages

html-template-generator 0.3.0 
minimap 4.29.9 
Loobie commented 4 years ago

Hi, I received the same error... have you found a fix?

Also, since the generator command uses ctr-alt-l this package conflicts with atom-live-server

Is there a way to change the key commands so there is no conflict?

hirenscode commented 4 years ago

I went thru the code where the issue is, and what I understand from the code is that, it doesn't handle if Atom doesn't have a selected folder. And because there is no folder selected folder, path is undefined, and code is trying to operate string operations on an undefined object.