actengage / vuepress-plugin-template-constants

This plugin is to provide a way to define constants that are parsed before markdown and template components are rendered.
0 stars 0 forks source link

ReferenceError: EXE_DIR is not defined error is thrown #1

Open marcinjahn opened 3 years ago

marcinjahn commented 3 years ago

Hello, I have the following setup:

In config.js:

    plugins: [
     //some other plugins,
      ['vuepress-plugin-template-constants', {
        first: 'Benjamin'
      }]
    ],

In one of my markdown files:

<%= first %> 

When I run npm start I get:

tip Apply plugin template-constants (i.e. "vuepress-plugin-template-constants") ...
ReferenceError: EXE_DIR is not defined
    at eval (eval at <anonymous> (/home/marcin/code/ADP.Web.Edge/node_modules/lodash.template/index.js:1550:12), <anonymous>:8:10)
    at /home/marcin/code/ADP.Web.Edge/node_modules/vuepress-plugin-template-constants/markdown.js:10:56
    at Array.<anonymous> (/home/marcin/code/ADP.Web.Edge/node_modules/vuepress-plugin-template-constants/markdown.js:19:33)
    at Core.process (/home/marcin/code/ADP.Web.Edge/node_modules/markdown-it/lib/parser_core.js:51:13)
    at MarkdownIt.parse (/home/marcin/code/ADP.Web.Edge/node_modules/markdown-it/lib/index.js:523:13)
    at module.exports (/home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/shared-utils/lib/extractHeaders.js:22:23)
    at Page.process (/home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/core/lib/node/Page.js:117:25)
    at async App.addPage (/home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/core/lib/node/App.js:354:5)
    at async /home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/core/lib/node/App.js:339:7
    at async Promise.all (index 20)
    at async App.resolvePages (/home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/core/lib/node/App.js:337:5)
    at async App.process (/home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/core/lib/node/App.js:115:5)
    at async dev (/home/marcin/code/ADP.Web.Edge/node_modules/@vuepress/core/lib/index.js:17:3)
npm ERR! code 1
npm ERR! path /home/marcin/code/ADP.Web.Edge
npm ERR! command failed
npm ERR! command sh -c vuepress dev --no-clear-screen src

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/marcin/.npm/_logs/2021-05-24T13_58_38_447Z-debug.log
marcinjahn commented 3 years ago

I found out that the error is thrown because in one of the markdown files I have:

Here is an example of a Dockerfile:

\`\`\`docker
FROM mcr.microsoft.com/dotnet/core/runtime:2.2
ARG EXE_DIR=.
COPY ${EXE_DIR}/bin/Release/netcoreapp2.2/publish/* /app/
ENTRYPOINT ["dotnet", "app.dll"]
\`\`\`

So, basically, the plugin might not always work.