parceljs

Heroku only displaying backend of MERN app. How can I fix this?

送分小仙女□ 提交于 2021-02-10 06:27:19
问题 I've finished working on my first MERN app. It works locally and it was 'successfully built' on Heroku but all that is displayed is the backend-data retrieved for the '/' route from MongoDB. I've looked at a couple of resources that discuss deploying MERN stack apps to Heroku here: 1. https://www.freecodecamp.org/forum/t/solved-deployment-problem-showing-backend/280178 2. https://www.freecodecamp.org/news/how-to-deploy-a-react-app-with-an-express-server-on-heroku-32244fe5a250/ I've tried

How to use import with absolute paths in Cypress tests built with ParcelJS?

江枫思渺然 提交于 2021-01-28 01:16:45
问题 I'm using imports with absolute paths in my Parcel project but these absolute paths aren't equally resolved by Cypress tests. Difference in module resolution Parcel : import {foo} from '/foo.js' : relatively to project root Cypress : import {foo} from '/foo.js' : absolute on disk root When Parcel's entry point is in src folder importing /foo.js anywhere in the project looks for file in path <project>/src/foo.js . (Docs: https://parceljs.org/module_resolution.html#absolute-paths) But Cypress

Can't find /bundle.js.map on the server Node.js

感情迁移 提交于 2021-01-05 07:33:04
问题 I am following a tutorial , now i am getting this error when i try to update a user data , i have tried to re-install parcel package npm install -g bundle-js here is package.json: here is directory: since my bundle.js and bundle.js.map is under the /public/js , how can i route the directory 回答1: Well, once bundler.js has been compiled if we open it and scroll to the very bottom, there is a line: //# sourceMappingURL=/bundle.js.map We can manually type the correct path like //#

How to build assets separately from the rest of the app with Parcel

扶醉桌前 提交于 2021-01-02 19:01:21
问题 I have a project that I am building with parcel. Since it is mostly static, I only have some files that should be updated once a day, I put the project on aws s3 bucket. I am thinking of updating the files that should be updated once a day, with a lambda function. But, in my project that is structured like this: src/ assets/ components/ main.js ... In the folder assets, I have two other folders data and icons. Data folder holds json files that should be updated once a day. assets/data/ /icons

Parcel - Babel - Vue - Error: Cannot find module `…/…/img.svg`

自古美人都是妖i 提交于 2020-12-13 03:41:07
问题 Im a bit in the dark therefore reaching out as I couldnt find a solution or answer. Im using parcel with Vue and trying to import a static image as ../img/logo.svg . This used to work before until I introduced Babel to the mix. Now I get Error: Cannot find module 'img/logo.svg' during runtime. It is weird because in the dist folder I see a logo.svg with a hash. Is it a babel or parcel issue? do I need some extra plugin? or something Im missing?. Im basically using babel out the box. I just

Parcel - Babel - Vue - Error: Cannot find module `…/…/img.svg`

回眸只為那壹抹淺笑 提交于 2020-12-13 03:35:59
问题 Im a bit in the dark therefore reaching out as I couldnt find a solution or answer. Im using parcel with Vue and trying to import a static image as ../img/logo.svg . This used to work before until I introduced Babel to the mix. Now I get Error: Cannot find module 'img/logo.svg' during runtime. It is weird because in the dist folder I see a logo.svg with a hash. Is it a babel or parcel issue? do I need some extra plugin? or something Im missing?. Im basically using babel out the box. I just

Importing images in TypeScript React - “Cannot find module”

心不动则不痛 提交于 2020-07-05 05:17:08
问题 I am trying to import images to use inside a React component with TypeScript. The bundler I'm using is Parcel (not Webpack). I have created a .d.ts file inside the project with the image file extension, and included it inside tsconfig.json . However, when I try to import an image, TS yells at me about Cannot find module . My project structure: + src + assets - image.jpg + components - Box.tsx - App.tsx - index.d.ts - index.html - index.tsx - tsconfig.json - tslint.json I tried to import the

Dynamic locals unavailable with Pug and Parcel

只愿长相守 提交于 2020-04-13 18:04:38
问题 I have an Express app using Pug templates and Parcel for my bundler. According to the Parcel docs, I can have a config file that stores my locals pug.config.js , however, I need to dynamically add locals to my templates at runtime. Is it possible to do this? Here are my files: index.pug ... h1 #{isAuthenticated} h1 #{env} ... pug.config.js module.exports = { locals: { env: process.env.NODE_ENV } } app.js const Bundler = require('parcel-bundler') const bundler = new Bundler(path.resolve(_

Dynamic locals unavailable with Pug and Parcel

独自空忆成欢 提交于 2020-04-13 18:03:32
问题 I have an Express app using Pug templates and Parcel for my bundler. According to the Parcel docs, I can have a config file that stores my locals pug.config.js , however, I need to dynamically add locals to my templates at runtime. Is it possible to do this? Here are my files: index.pug ... h1 #{isAuthenticated} h1 #{env} ... pug.config.js module.exports = { locals: { env: process.env.NODE_ENV } } app.js const Bundler = require('parcel-bundler') const bundler = new Bundler(path.resolve(_

Parcel not being intalled

谁说我不能喝 提交于 2019-12-23 20:54:15
问题 I am trying to add parcel bundler to my machine. Here is the list of commands that I have tried in order. npm cache clean -f npm install npm@latest -g npm install -g parcel-bundler Parcel then appears to have installed correctly, but it does not. RELATED QUESTION: Cannot run parcel command When I try and run parcel --version I get this bash: parcel: command not found Here are all the versions I am running on my machine parcel-bundler version 1.12.3 npm version 6.4.1 node version v10.11.0