Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Metronic 8.3.0 and Symfony

Greetings,

I have installed the starterkit for Symfony and followed the guides (which in my opinion are not helping) through trial and error.

For gulp I don't get any errors. but when I run symfony server:start only the Symfony landing page is showing (with 404 error at the bottom left). When I change in .env to APP_DEBUG=0 I get Oops! An Error Occurred The server returned a "404 Not Found".

For npm run build if I just run it I get: ~/starterkit/_keenthemes/tools$ npm run build

keenthemes@8.3.0 build webpack

[webpack-cli] Failed to load '/home//starterkit/_keenthemes/tools/webpack.config.js' config [webpack-cli] ReferenceError: require is not defined at file:///home//starterkit/_keenthemes/tools/webpack.config.js:1:17 at ModuleJobSync.runSync (node:internal/modules/esm/module_job:400:35) at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:427:47) at loadESMFromCJS (node:internal/modules/cjs/loader:1561:24) at Module._compile (node:internal/modules/cjs/loader:1712:5) at Object..js (node:internal/modules/cjs/loader:1895:10) at Module.load (node:internal/modules/cjs/loader:1465:32) at Function._load (node:internal/modules/cjs/loader:1282:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:235:24) If I remove the "type": "module", from package.json and run npm run build I get 5 errors: ~/starterkit/_keenthemes/tools$ npm run build

keenthemes@8.3.0 build webpack

Building... Failed to compile!

ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/plugins.scss 10:9 root stylesheet ERROR in ../src/sass/plugins.scss (../src/sass/plugins.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!../src/sass/plugins.scss) Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/plugins.scss 10:9 root stylesheet

ERROR in ../src/sass/style.scss (../src/sass/style.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!../src/sass/style.scss) Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/style.scss 6:9 root stylesheet

ERROR in ../src/sass/plugins.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/plugins.scss 10:9 root stylesheet at tryRunOrWebpackError (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/HookWebpackError.js:86:9) at webpack_require_module (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5475:12) at webpack_require (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5422:18) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5509:20 at symbolIterator (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3485:9) at done (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3527:9) at Hook.eval [as callAsync] (eval at create (/home//starterkit/_keenthemes/tools/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5397:43 at symbolIterator (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3482:9) at timesSync (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:2297:7) -- inner error -- Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/plugins.scss 10:9 root stylesheet at Object. (/home//starterkit/_keenthemes/tools/node_modules/css-loader/dist/cjs.js!/home//starterkit/_keenthemes/tools/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!/home//starterkit/_keenthemes/src/sass/plugins.scss:1:7) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:518:10 at Hook.eval [as call] (eval at create (/home//starterkit/_keenthemes/tools/node_modules/tapable/lib/HookCodeFactory.js:19:10), :7:1) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5477:39 at tryRunOrWebpackError (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/HookWebpackError.js:81:7) at webpack_require_module (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5475:12) at webpack_require (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5422:18) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5509:20 at symbolIterator (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3485:9) at done (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3527:9)

Generated code for /home//starterkit/_keenthemes/tools/node_modules/css-loader/dist/cjs.js!/home//starterkit/_keenthemes/tools/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!/home/*****/starterkit/_keenthemes/src/sass/plugins.scss 1 | throw new Error("Module build failed (from ./node_modules/sass-loader/dist/cjs.js):\nCan't find stylesheet to import.\n\u001b[34m ╷\u001b[0m\n\u001b[34m19 │\u001b[0m @import \u001b[31m"bootstrap/scss/functions"\u001b[0m;\n\u001b[34m │\u001b[0m \u001b[31m ^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[34m ╵\u001b[0m\n ../src/sass/_init.scss 19:9 @import\n ../src/sass/plugins.scss 10:9 root stylesheet");

ERROR in ../src/sass/style.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/style.scss 6:9 root stylesheet at tryRunOrWebpackError (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/HookWebpackError.js:86:9) at webpack_require_module (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5475:12) at webpack_require (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5422:18) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5509:20 at symbolIterator (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3485:9) at done (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3527:9) at Hook.eval [as callAsync] (eval at create (/home//starterkit/_keenthemes/tools/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5397:43 at symbolIterator (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3482:9) at timesSync (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:2297:7) -- inner error -- Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Can't find stylesheet to import. ╷ 19 │ @import "bootstrap/scss/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ../src/sass/_init.scss 19:9 @import ../src/sass/style.scss 6:9 root stylesheet at Object. (/home//starterkit/_keenthemes/tools/node_modules/css-loader/dist/cjs.js!/home//starterkit/_keenthemes/tools/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!/home//starterkit/_keenthemes/src/sass/style.scss:1:7) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:518:10 at Hook.eval [as call] (eval at create (/home//starterkit/_keenthemes/tools/node_modules/tapable/lib/HookCodeFactory.js:19:10), :7:1) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5477:39 at tryRunOrWebpackError (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/HookWebpackError.js:81:7) at webpack_require_module (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5475:12) at webpack_require (/home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5422:18) at /home//starterkit/_keenthemes/tools/node_modules/webpack/lib/Compilation.js:5509:20 at symbolIterator (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3485:9) at done (/home//starterkit/_keenthemes/tools/node_modules/neo-async/async.js:3527:9)

Generated code for /home//starterkit/_keenthemes/tools/node_modules/css-loader/dist/cjs.js!/home//starterkit/_keenthemes/tools/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!/home/*****/starterkit/_keenthemes/src/sass/style.scss 1 | throw new Error("Module build failed (from ./node_modules/sass-loader/dist/cjs.js):\nCan't find stylesheet to import.\n\u001b[34m ╷\u001b[0m\n\u001b[34m19 │\u001b[0m @import \u001b[31m"bootstrap/scss/functions"\u001b[0m;\n\u001b[34m │\u001b[0m \u001b[31m ^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[34m ╵\u001b[0m\n ../src/sass/_init.scss 19:9 @import\n ../src/sass/style.scss 6:9 root stylesheet");

ERROR in ./webpack/plugins/plugins.js 104:17-58 Module not found: Error: Package path ./dist/countUp.min.js is not exported from package /home//starterkit/_keenthemes/tools/node_modules/countup.js (see exports field in /home//starterkit/_keenthemes/tools/node_modules/countup.js/package.json)

webpack compiled with 5 errors symfony server:start shows the same.

What I am missing here? why everything is so complicated, I need to start working on my project, NOT for composer, yarn, node, symfony or Metronic to update/fix dependencies, vulnerabilities (8 critical!) and errors.

Best regards, PD

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Hi PD

You may run composer install and symfony server:start without to rebuild assets.

Please try to extract from the zip file and run the symfony command to start.


Build assets is optional, but could you please modify these files as workaround?

/_keenthemes/src/sass/_init.scss

@import "../../tools/node_modules/bootstrap/scss/functions";
@import "../../tools/node_modules/bootstrap/scss/variables";
@import "../../tools/node_modules/bootstrap/scss/variables-dark";
@import "../../tools/node_modules/bootstrap/scss/maps";
@import "../../tools/node_modules/bootstrap/scss/mixins";
@import "../../tools/node_modules/bootstrap/scss/utilities";


/_keenthemes/src/sass/components/components.scss

@import "../../../tools/node_modules/bootstrap/scss/bootstrap";



It's the same with the changes you said.

I tried the following:
I set a route for dashboard in config/routes.yaml:
app_dashboard:
path: /dashboard
controller: App\Controller\DashboardController::index


bin/console debug:router
-------------------------- -------- -------- ------ -----------------------------------
Name Method Scheme Host Path
-------------------------- -------- -------- ------ -----------------------------------
_preview_error ANY ANY ANY /_error/{code}.{_format}
_wdt_stylesheet ANY ANY ANY /_wdt/styles
_wdt ANY ANY ANY /_wdt/{token}
_profiler_home ANY ANY ANY /_profiler/
_profiler_search ANY ANY ANY /_profiler/search
_profiler_search_bar ANY ANY ANY /_profiler/search_bar
_profiler_phpinfo ANY ANY ANY /_profiler/phpinfo
_profiler_xdebug ANY ANY ANY /_profiler/xdebug
_profiler_font ANY ANY ANY /_profiler/font/{fontName}.woff2
_profiler_search_results ANY ANY ANY /_profiler/{token}/search/results
_profiler_open_file ANY ANY ANY /_profiler/open
_profiler ANY ANY ANY /_profiler/{token}
_profiler_router ANY ANY ANY /_profiler/{token}/router
_profiler_exception ANY ANY ANY /_profiler/{token}/exception
_profiler_exception_css ANY ANY ANY /_profiler/{token}/exception.css
app_dashboard ANY ANY ANY /dashboard
-------------------------- -------- -------- ------ -----------------------------------


php bin/console debug:router app_dashboard

+--------------+----------------------------------------------------------+
| Property | Value |
+--------------+----------------------------------------------------------+
| Route Name | app_dashboard |
| Path | /dashboard |
| Path Regex | {^/dashboard$}sDu |
| Host | ANY |
| Host Regex | |
| Scheme | ANY |
| Method | ANY |
| Requirements | NO CUSTOM |
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: App\Controller\DashboardController::index() |
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
| | utf8: true |
+--------------+----------------------------------------------------------+


php bin/console debug:autowiring --all | grep ThemeHelper
App\Service\ThemeHelper

Navigating to I get the following error:
Variable "theme" does not exist in pages/dashboards/index.html.twig at line 1.

templates/pages/dashboards/index.html.twig:1:
{% extends "#{theme.getParameter('KT_THEME_LAYOUT_DIR')}/_default.html.twig" %}

It seems src/Service/ThemeHelper.php is not used.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(