From 280983fa88d488dbbd95d3f15c1cebac34346669 Mon Sep 17 00:00:00 2001 From: Jonas Galvez Date: Fri, 17 Aug 2018 05:22:52 -0300 Subject: [PATCH] fix: remove string interpolation from App.js (#3750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In migrating an `1.4.2` app to edge, I came across this bug: ``` ✖ fatal Error: Could not compile template /Users/jonas/.../node_modules/nuxt-edge/lib/app/App.js: layout is not defined ``` Upon much investigation, I traced it to the string interpolation used in the `App.js` template. I replaced with regular concatenation and the error was gone. --- lib/app/App.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app/App.js b/lib/app/App.js index 9d1c64068e..575d2cba00 100644 --- a/lib/app/App.js +++ b/lib/app/App.js @@ -88,8 +88,8 @@ export default { }, loadLayout (layout) { const undef = !layout - const inexisting = !(layouts[`_${layout}`] || resolvedLayouts[`_` + layout]) - let _layout = `_${(undef || inexisting) ? 'default' : layout}` + const inexisting = !(layouts['_' + layout] || resolvedLayouts['_' + layout]) + let _layout = '_' + ((undef || inexisting) ? 'default' : layout) if (resolvedLayouts[_layout]) { return Promise.resolve(resolvedLayouts[_layout]) }