11ty / eleventy-plugin-vue

Use Vue.js templates and Vue.js single file components in Eleventy.
196 stars 11 forks source link

inputPath option throws error: The "path" argument must be of type string. Received undefined #29

Closed gluecksmensch closed 2 years ago

gluecksmensch commented 3 years ago

When using the inputPath option

eleventyConfig.addPlugin(
    eleventyVue,
    {
      input: ["src/pages/page.vue"],
    }
};

eleventy throws an error:

Problem writing Eleventy templates: (more in DEBUG output)
> The "path" argument must be of type string. Received undefined

`TypeError` was thrown:
    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
        at validateString (internal/validators.js:124:11)
        at Object.join (path.js:1039:7)
        at EleventyVue.getFullJavaScriptComponentFilePath (/Users/dh/Projects/magix/node_modules/@11ty/eleventy-plugin-vue/EleventyVue.js:256:34)
        at EleventyVue.getComponent (/Users/dh/Projects/magix/node_modules/@11ty/eleventy-plugin-vue/EleventyVue.js:261:34)
        at Object.getInstanceFromInputPath (/Users/dh/Projects/magix/node_modules/@11ty/eleventy-plugin-vue/.eleventy.js:85:26)
        at CustomEngine.getExtraDataFromFile (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/Engines/Custom.js:64:37)
        at async Template.getFrontMatterData (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/TemplateContent.js:144:21)
        at async Template.getData (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/Template.js:235:29)
        at async Template.getTemplateMapEntries (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/Template.js:744:16)
        at async TemplateMap.add (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/TemplateMap.js:32:21)
        at async Promise.all (index 0)
        at async TemplateWriter._createTemplateMap (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/TemplateWriter.js:169:5)
        at async TemplateWriter.writeTemplates (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/TemplateWriter.js:203:5)
        at async TemplateWriter.write (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/TemplateWriter.js:254:25)
        at async Eleventy.write (/Users/dh/Projects/magix/node_modules/@11ty/eleventy/src/Eleventy.js:743:13)

Node: v14.15.4 npm: 6.14.10

zachleat commented 3 years ago

If you try the latest canary you’ll get a better error message for this. I believe it happens when you try to import another SFC that the Vue plugin doesn’t know about? What are you importing from src/pages/page.vue?

zachleat commented 2 years ago

This is an automated message to let you know that this issue requires additional input from the original poster and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

Do not let the issue’s closing deter you. After you’ve supplied the required information, the issue will be reopened. Thanks!