Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Bugs Microweber v2.0.2 (Internal Error 500, and Non loading public assets) #1037

Open
Xees opened this issue Oct 31, 2023 · 6 comments

Comments

@Xees
Copy link

Xees commented Oct 31, 2023

Installation is on a local dev environment.
Apache httpd-2.4.54
MySQL 8.0.30
PHP 8.1

Browsing through a custom domain routed through local host 'cms.test' that directly opens the core directory (microweber), the website opens fine and correctly routes to /public without having to add it in the URL Slug.

The first error is the following: with Module Comments.

Failed to load resource: the server responded with a status of 500 (Internal Server Error)


Error 500 - Internal Server Error - { "message": "Class \"MicroweberPackages\\Modules\\Comments\\Models\\Comment\" not found", "exception": "Error", "file": "C:\\dev\\www\\naizk_cms\\userfiles\\modules\\comments\\dashboard_recent_comments.php", "line": 2, "trace": [ { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\View\\View.php", "line": 78, "function": "include" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Utils\\ParserLoadModuleTrait.php", "line": 425, "function": "__toString", "class": "MicroweberPackages\\View\\View", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Utils\\ParserLoadModuleTrait.php", "line": 57, "function": "load_module_callback", "class": "MicroweberPackages\\App\\Utils\\ParserProcessor", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Utils\\ParserProcessor.php", "line": 1010, "function": "load", "class": "MicroweberPackages\\App\\Utils\\ParserProcessor", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Utils\\Parser.php", "line": 90, "function": "process", "class": "MicroweberPackages\\App\\Utils\\ParserProcessor", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Http\\Controllers\\ApiController.php", "line": 1105, "function": "process", "class": "MicroweberPackages\\App\\Utils\\Parser", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php", "line": 54, "function": "module", "class": "MicroweberPackages\\App\\Http\\Controllers\\ApiController", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php", "line": 43, "function": "callAction", "class": "Illuminate\\Routing\\Controller", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 260, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 205, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 799, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 141, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Http\\Middleware\\SameSiteRefererMiddleware.php", "line": 35, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "MicroweberPackages\\App\\Http\\Middleware\\SameSiteRefererMiddleware", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 116, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 800, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 777, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 741, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 730, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 200, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 141, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\barryvdh\\laravel-debugbar\\src\\Middleware\\InjectDebugbar.php", "line": 59, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\livewire\\livewire\\src\\DisableBrowserCache.php", "line": 19, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Livewire\\DisableBrowserCache", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\TrustProxies.php", "line": 39, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Http\\Middleware\\TrustProxies", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\fruitcake\\laravel-cors\\src\\HandleCors.php", "line": 38, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Fruitcake\\Cors\\HandleCors", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance.php", "line": 89, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings.php", "line": 40, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php", "line": 121, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php", "line": 64, "function": "handleStatefulRequest", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\src\\MicroweberPackages\\App\\Http\\Middleware\\StartSessionExtended.php", "line": 22, "function": "handle", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "MicroweberPackages\\App\\Http\\Middleware\\StartSessionExtended", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull.php", "line": 31, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php", "line": 37, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 116, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 175, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 144, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "C:\\dev\\www\\naizk_cms\\public\\index.php", "line": 79, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" } ] }

The second error is failure to load the /public/build/assets/@core-481bf48f.js, and admin-app-53615c11.js.

as follows:

public/build/assets/admin-app-53615c11.js:1  Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
public/build/assets/@core-481bf48f.js:1  Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
@peter-mw
Copy link
Member

peter-mw commented Nov 1, 2023

thanks we will take a look, did you update from older version or made fresh install ?

@Xees
Copy link
Author

Xees commented Nov 10, 2023

Fresh install, simply downloaded the one on your site. Then when it didn't work tried the latest github release.

@anmiefan
Copy link

anmiefan commented Nov 28, 2023

i am getting this thing when i updated from ver 1.3.1 my site still works but admin shows 500 SERVER ERROR

my Microweber ver now is 2.05 i think my php ver is 8.1

@Xees
Copy link
Author

Xees commented Dec 23, 2023

I've figured out the problem.

Vite is outputting the URL for assets with /public/ in the HTML, and this causes the site to not resolve properly unless your running the site directly from the public directory.

But if your running from the root directory, and want to redirect to public via htaccess. This won't work and will require a fix.

I;ve resolved it by doing the following inside the Vite resolvePreloadTagAttributes, and makeScriptTagWithAttributes, and makeStylesheetTagWithAttributes functions.
// this is necessary because the html output contains /public/ in the paths.
$url = str_replace('/public/', '/', $url);

@Xees
Copy link
Author

Xees commented Dec 23, 2023

thanks we will take a look, did you update from older version or made fresh install ?

Please try to add a workaround for this issue, it's simple just configure vite to figure output url for asset management in html correctly if the user is running the site directly from root and not from public.

@incnet
Copy link

incnet commented Mar 9, 2024

Was this resolved, i recently just did a fresh install and i keep getting the 500 error whenever i click on the admin page,.. i might just bench microweber for now, was hoping things to work smoothly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants