Problem When Deploying Sveltekit Project to Vercel - javascript

So I Was trying to deploy my Sveltekit app with Vercel but this happened:
Cloning completed: 221.226ms
Previous build cache not available
Using prebuilt build artifacts...
Error: Config file was not found at "/vercel/path0/.vercel/output/config.json"
at P8 (/var/task/sandbox.js:315:2645)
My svelte.config.js file:
import vercel from '#sveltejs/adapter-vercel'
/** #type {import('#sveltejs/kit').Config} */
const config = {
kit: {
adapter: vercel()
}
};
export default config;
As you can see I do have the adapter for Vercel imported and in use. So what is the Problem Here? I can figure it out
My build command is: pnpm run build
My output directory is: .svelte-kit
My install command is: pnpm install

Your output directory should be left blank (or set to .), not .svelte-kit — that's a place for SvelteKit to do its work, it's of no concern to Vercel.

Related

Astro ssr can not find css files

Followed Astro instructions to build Astro app
But the app can not find the assets
Steps to produce:
Create empty astro project from template
Add #astro/node to project npx astro add node
Run npm run build
Serve the server node ./dist/server/entry.mjs as documentation said
It gives this error like below and doesn't apply css.
I recommend you try with the latest version or provide the version you tested with.
I tried the same steps as you did, using
npx astro create
npx astro add node
which used version v1.6.15
I did got a build error Setting the 'mode' option is required so I updated the astro.config.js to look as follows :
import { defineConfig } from 'astro/config';
// https://astro.build/config
import node from "#astrojs/node";
// https://astro.build/config
export default defineConfig({
output: "server",
adapter: node({
mode: 'standalone'
})
});
after that build and run went smooth
npm run build
node ./dist/server/entry.mjs
as you can see css correctly loaded

Laravel Deployment - Module not found: Can't resolve 'Quill'

I'm having issues deploying my laravel project onto my Digital Ocean server using Laravel Forge. npm run prod and npm run watch work perfect on localhost but when I deploy the project live I get errors compiling the JS.
/node_modues/quill/ is definitely installed on the server too.
Here is the error:
ERROR in ./resources/js/user.js 3:15-31
Module not found: Error: Can't resolve 'Quill' in '/home/forge/sieved.co/resources/js'
My user.js file:
require('./quill.js');
window.Quill = require('Quill');
var quill = new Quill('#editor', {
theme: 'snow'
});
My quill.js file also in the resources folder:
import Quill from 'quill/core';
import Toolbar from 'quill/modules/toolbar';
import Snow from 'quill/themes/snow';
import Bold from 'quill/formats/bold';
import Italic from 'quill/formats/italic';
import Header from 'quill/formats/header';
Quill.register({
'modules/toolbar': Toolbar,
'themes/snow': Snow,
'formats/bold': Bold,
'formats/italic': Italic,
'formats/header': Header
});
export default Quill;
I don't get these errors locally so I'm confused what could be causing it to happen on the server. Thanks.
You are missing a JS dependency, the package Quill.
You can either install it using npm by running npm install quill or pulling it from a CDN. See Quills homepage for details.
Then you can include it by using window.Quill = require('quill'); Please see the lowercase writing quill instead of your Quill inside the require.

ReactJS [issue on production] - TypeError: (void 0) is not a function

I'm facing the above error on production build, not even getting the issue reference...
your help will really be appreciated, Thanks in advance.
Note - on local, it works fine - development mode, but the same code won't work on a production.
React js version is - 16.12.0, and webpack version - 4.41.6
I had this issue when working with team and we don't have git ignore for ios project so the core files doesn't belong to the same compiler , i managed to resolve this issue by first deleting ios folder (if you use pod copy podfile)
then
react-native upgrade --legacy true
copy your pod file again to the new ios folder
cd ios pod install cd -
open your project in xcode and build
select schema to release then build again
Don't forget to have git ignore as follow
Facing this issue when trying to import something that is not exported from a module. I'm sure this is the case only for PRODUCTION build, not for development.
Probably, this error is only applicable for Webpack 4 and has been fixed in Webpack 5.
In my case:
index.js of a module:
export {
foo,
} from './utils';
Your file:
import * as Utils from 'utils';
Utils.bar(); // bar is not exported!
Production bundle contains: (void 0)() // crashes!
Development bundle contains user friendly comment:
/* Cannot get final name for export "bar" in
"./node_modules/utils/index.js" (known exports: foo) */
undefined();
and fails silently 🤷🏼‍♂️

How does angular pickup on services with are specified using directory/Folder paths?

I was just going through the ngx-admin code on github and came across the following code in the header.ts file:
See here
import { NbMenuService, NbSidebarService } from '#nebular/theme';
Now when i run this project locally and run npm install after all dependencies have been installed and i move to the folder #nebular/theme i don't see any service files also #nebular/theme seems a path to a directory vs a path to a service , how does angular pickup on these services ?

Adding chai-as-promised to an Ember app

I'm finding myself in an Ember-based app and are having a little trouble understanding how I should add the chai-as-promised helper library to it. I'm running this version:
$ ember --version
version: 2.4.2
node: 5.8.0
os: darwin x64
I started by installing via npm i chai-as-promised --save-dev. The library was then importable via Node. Then I have tried adding it to the ember-cli-build.js file using two different approaches:
As a file via .import(), after creating the EmberApp:
module.exports = function(defaults) {
var app = new EmberApp([...]);
app.import('./node_modules/chai-as-promised/lib/chai-as-promised.js');
Via EmberApp.toTree() to chai-as-promised's top directory:
return app.toTree('./node_modules/ember-cli-blueprint-test-helpers/');
And descending into the lib/ subdirectory of chai-as-promised:
return app.toTree('./node_modules/chai-as-promised/lib');
I also tried installing via Bower and changing the above node_modules/ based paths to bower_components ones, but still with the same result.
Am I importing it wrong? Or is there somewhere else I should import?
You need to tell ember-cli to add it to the test tree like this:
app.import("bower_components/chai-as-promised/lib/chai-as-promised.js",
{ type: 'test' });
otherwise it isn't available in the test suite but in the app. I got this to work in combination with ember-cli-mocha.
You can see how it works here: https://github.com/albertjan/ember-cli-chai-as-promised

Categories