How to import 'into-stream' package?

Issue Code: const express = require(‘express’); const app = express(); const cors = require(‘cors’); const mongoose = require(‘mongoose’); const multer = require(‘multer’); const inMemoryStorage = multer.memoryStorage(); const uploadStrategy = multer({ storage: inMemoryStorage }).single(‘image’); const { BlockBlobClient } = require(‘@azure/storage-blob’); const

Continue reading

Using DOTENV correctly

Issue I have a db.js file like so import "dotenv/config"; const devConfig = `"${process.env.PG_USER}://${process.env.PG_USER}:${process.env.PG_PASSWORD}@${process.env.PG_HOST}:${process.env.PG_PORT}/${process.env.PG_DATABASE}"`; const prodConfig = process.env.DATABASE_URL; const dbConnection = process.env.NODE_ENV === "production" ? prodConfig : devConfig; console.log(dbConnection); export default dbConnection; The console.log function correctly outputs the string that

Continue reading

'X Is not a function' in CommonJS

Issue I’ve got the following code I transformed from a Trypescript, ESM-syntax based file to a Javascript, CJS-syntax file. const apiClientFactory = require("@vue-storefront/core"); function onCreate(settings) { return { config: settings, client: {}, }; } const getPrice = () => {

Continue reading

'X Is not a function' in CommonJS

Issue I’ve got the following code I transformed from a Trypescript, ESM-syntax based file to a Javascript, CJS-syntax file. const apiClientFactory = require("@vue-storefront/core"); function onCreate(settings) { return { config: settings, client: {}, }; } const getPrice = () => {

Continue reading

Access html5 data-* attributes defined in a module script

Issue When loading scripts without using modules, I could use the document.currentscript to access custom attributes. E.g. <script src="js/myscript.js" data-custom-attribute="my-value"></script> Within myscript.js I can then do the following // will contain "my-value" const myAttribute = document.currentScript.getAttribute(‘data-custom-attribute’); If I load the

Continue reading