Run SvelteKit app on production as server - build

I have an app created with last SveltieKit, how can I run results of npm run build as server?
After build I have created .sveltie-kit folder with multiple files inside. I tried to run node .sveltie-kit/build/server.js but it does not work.
Versions:
"devDependencies": {
"#sveltejs/adapter-auto": "^1.0.0",
"#sveltejs/kit": "^1.0.1",
"#sveltejs/vite-plugin-svelte": "^2.0.2",
"#tsconfig/svelte": "^3.0.0",
"#types/express": "^4.17.15",
"node-sass": "^8.0.0",
"sass": "^1.57.1",
"svelte": "^3.55.0",
"svelte-check": "^3.0.1",
"svelte-preprocess": "^5.0.0",
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"vite": "^4.0.3"
},

If you want SvelteKit to generate a standalone Node server you have to use the node adapter.
// svelte.config.js
import adapter from '#sveltejs/adapter-node';
export default {
kit: {
adapter: adapter()
}
};
By default this will create a build directory you can run node on.
node build

Related

How do i solve Expo problem SDK 46 when i do eas update?

i update my cli and the version of my app .
My expo go is now SDK 46 supported.
Before to do eas update, my app was working well on my phone.
Since that, i have this message when i try to do expo start and eas update with the public link
Do you think it could from an other package ?
this is also my package.json
"dependencies": {
"expo": "~46.0.7",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-native": "0.69.4",
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-community/datetimepicker": "6.2.0",
"#react-navigation/bottom-tabs": "^6.3.1",
"#react-navigation/native": "^6.0.10",
"#react-navigation/native-stack": "^6.6.2",
"expo-checkbox": "~2.2.0",
"expo-cli": "6.0.0",
"expo-location": "~14.3.0",
"expo-media-library": "~14.2.0",
"expo-splash-screen": "~0.16.1",
"expo-updates": "~0.14.4",
"moment": "^2.29.4",
"react-dom": "18.0.0",
"react-native-calendars": "^1.1275.0",
"react-native-maps": "0.31.1",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-web": "~0.18.7"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
"private": true
}
Make sure your Expo config file in app.json or app.config.js specifies the correct sdkVersion.
{
"expo": {
...
"sdkVersion": "46.0.0", // I was missing this line
...
}
}
You need to do expo upgrade in command line to update your SDK version. This same if you test on your phone, you need to update expo app on a store. Then you gotta have same SDK versions.

Pre-commit hook (husky + pretty-quick) doesn't work

I've configured prettier and pre-commit hook like before but in my new project husky doesn't run before any commit!
Below is part of the project package.json file:
{
...,
"devDependencies": {
"husky": "^4.3.6",
"prettier": "2.2.1",
"pretty-quick": "^3.1.0"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
I was running into the same problem but i'm using husky ^5.0.9.
Then i read the docs that you need to run npx husky install.
That fixed it for me
In pre-commit, use npm in front of pretty-quick
npx pretty-quick --staged
you should use "husky": "^2.7.0", "prettier": "^1.18.2", "pretty-quick": "^1.11.1",

Popper.js problem with Bootstrap modals in Laravel 5.8

I'm creating a web application based on Laravel 5.8 + Laravelmix + bootstrap + Vue
(which is how Lravel comes out of the box)
Problem is that bootstrap modals will not work - not out of the box at least.
If you try to trigger a modal you get an error in the console, regarding a popper map component (needed by jquery) that is there (in fact) but for some reason it doesn't get properly added to the mix.
This is a know problem: I found other questions and threads about this problem in Stackoverflow, however...
Problem in the problem: all existing QAs that i found take for granted that who reads knows quite a lot about npm webpack and laravel mix... and I don't! :-( I'm mostly a backend developer, not a frontend dev: I know basic Javascript but don't know much about webpack and I haven't been able to apply the suggested solutions to my case.
Could somebody explain to me in clear terms how my js assets should look like in order to work???
This is my webpack.mix file:
const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
This is my resources/js/app.js file:
require('./bootstrap');
window.Vue = require('vue');
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
const app = new Vue({
el: '#app',
});
This is the beginning of my resoureces/js/bootstrap.js file looks like:
window._ = require('lodash');
try {
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');
require('bootstrap');
} catch (e) {}
window.axios = require('axios');
And finally this is my package.json file:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.5",
"popper.js": "^1.12",
"resolve-url-loader": "2.3.1",
"sass": "^1.20.1",
"sass-loader": "7.*",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
}
}

Unexpected token error when migrating to native classes for components

I upgraded to Ember 3.11 and I want to start using native classes for my components.
When I change a component class to something similar like:
export default class MyClassName extends BaseComponent {
myFieldName;
}
I get a build error
"Parsing error: Unexpected token ;" because of the class field.
Ideas how to make sure ember-cli doesn't complain about the new syntax are more than welcome.
Thanks
UPDATE:
Following jelhan's suggestion below I updated my package.json file as in ember-cli/ember-new-output (https://github.com/ember-cli/ember-new-output/blob/master/package.json). This didn’t help. I also created a brand new ember project with a single component in it and I still have the same problem.
This is the package.json file which gets generated when creating new ember project (ember-cli 3.11.0):
{
"name": "my-project",
"version": "0.0.0",
"private": true,
"description": "Small description for my-project goes here",
"repository": "",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test"
},
"devDependencies": {
"#ember/jquery": "^0.6.0",
"#ember/optional-features": "^0.7.0",
"broccoli-asset-rev": "^3.0.0",
"ember-ajax": "^5.0.0",
"ember-cli": "~3.11.0",
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.7.3",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
"ember-cli-inject-live-reload": "^1.8.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-data": "~3.11.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^2.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.4.1",
"ember-resolver": "^5.0.1",
"ember-source": "~3.11.1",
"ember-welcome-page": "^4.0.0",
"eslint-plugin-ember": "^6.2.0",
"eslint-plugin-node": "^9.0.1",
"loader.js": "^4.7.0",
"qunit-dom": "^0.8.4"
},
"engines": {
"node": "8.* || >= 10.*"
}
}
Seems like the new syntax works fine. The javascript code executes as expected. I guess the errors I see in the build output are eslint errors only. I need to figure out how to configure eslint to understand the new syntax.
as #Lux pointed out in a comment, the value is missing.
This will fix your syntax error:
export default class MyClassName extends BaseComponent {
myFieldName = undefined;
}
Also, be sure to have the latest version of ember-cli-babel installed to ensure that you have the latest bundled set of babel plugins -- earlier versions of ember-cli-babel did not support classes. The latest at the time of writing this is 7.10.0 https://www.npmjs.com/package/ember-cli-babel
In classic syntax, this would be the equivalent of:
export default BaseComponent.extend({
myFieldName: undefined,
});
If you're curious about more of the differences -- here is a bit more information on native javascript classes in Ember from the ember-decorators documentation: https://ember-decorators.github.io/ember-decorators/docs/native-class-basics
On a somewhat related note:
I know it's been common in Ember to define all the properties a component may receive at the top to declare its API, but now is actually a really good time to get in to TypeScript, so that you may add more semantic meaning to your classes.
Initializing a property as undefined is the same as not specifying it, so with TypeScript, you can attain better semantics with:
interface Args {
myFieldName: string;
}
export default class MyClassName extends BaseComponent<Args> {
}
Assuming BaseComponent is a Glimmer Component, info here: https://octane-guides-preview.emberjs.com/release/upgrading/editions/#toc_tracked-properties
(EmberComponents don't accept Type Arguments, as far as I know)

Any idea why cloneDeep is broken in apollo-utilities with vue, nginx and aws

Someone has an idea why a project compiled for production, runs well in local, when I deploy it in aws with the same environment, almost all the queries to graphql throw the error:
TypeError: property descriptors must not specify a value or be writable when a getter or setter has been specified
Local OS:
nginx 1.14
manjaro 18
Remote OS (AWS):
nginx 1.14
Ubuntu 18.04
Package.json dependencies, both enviroments:
"#mdi/font": "^2.5.94",
"apollo-cache-inmemory": "^1.2.5",
"apollo-client": "^2.4.3",
"apollo-link-context": "^1.0.8",
"apollo-link-http": "^1.5.4",
"apollo-server": "^2.1.0",
"apollo-upload-client": "^9.0.0",
"axios": "^0.18.0",
"buefy": "^0.6.7",
"cors": "^2.8.4",
"express": "^4.16.3",
"graphql": "^0.12.3",
"graphql-tag": "^2.6.1",
"moment": "^2.22.2",
"nprogress": "^0.2.0",
"sendmail": "^1.4.1",
"serve-static": "^1.13.2",
"vue": "^2.5.2",
"vue-apollo": "^3.0.0-alpha.3",
"vue-axios": "^2.1.3",
"vue-clipboard2": "^0.2.1",
"vue-router": "^3.0.1",
"vuelidate": "^0.7.4",
"vuex": "^3.0.1"