brikl / opensource Goto Github PK
View Code? Open in Web Editor NEWOpen source monorepo by BRIKL
License: MIT License
Open source monorepo by BRIKL
License: MIT License
On submitting an ajax form to Netlify Forms, I'm getting a 404 page being served. I have no special _redirects rules either.
curl 'https://beta.dfame.app/' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'referer: https://beta.dfame.app/' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cookie: _gid=GA1.2.1550095432.1605983334; _ga=GA1.1.1307560562.1605983334; _ga_37514942YF=GS1.1.1606014014.5.1.1606017875.0' \
--data-raw 'form-name=tppCreate&email=a%40az.com&url=demo.ghost.io&address=&balance=1' \
--compressed
It seems like this plugin override the _redirects file. How do I add my custom rules then?
The following code ensures that nextDir
is not undefined
:
https://github.com/Brikl/opensource/blob/master/libs/netlify-plugin-next-dynamic/src/index.ts#L15
However, nextDir
cannot be undefined
since the previous statement assigns a default value to it. Should this dead code be removed?
A top-level try
/catch
block is present:
This would incorrectly report uncaught exceptions (due to potential bugs) as user errors. Note: uncaught exceptions (e.g. throw new Error()
are reported as plugin bugs, while utils.build.failBuild()
are reported as user errors.
Instead, try
/catch
/utils.build.failBuild()
should only wrap (as tightly as possible) statements that are known to potentially throw due to user errors. This makes it possible to distinguish between plugin bugs and user errors.
The netlify-plugin-next-dynamic
is missing the tslib
dependency in production:
Could not import plugin:
Cannot find module 'tslib'
Require stack:
- /opt/build/repo/.netlify/plugins/node_modules/netlify-plugin-next-dynamic/index.js
- /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/logic.js
- /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/load.js
- /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/main.js
internal/modules/cjs/loader.js:957:15 Function.Module._resolveFilename
internal/modules/cjs/loader.js:840:27 Function.Module._load
internal/modules/cjs/loader.js:1019:19 Module.require
internal/modules/cjs/helpers.js:77:18 require
/opt/build/repo/.netlify/plugins/node_modules/netlify-plugin-next-dynamic/index.js:4:17 Object.<anonymous>
internal/modules/cjs/loader.js:1133:30 Module._compile
internal/modules/cjs/loader.js:1153:10 Object.Module._extensions..js
internal/modules/cjs/loader.js:977:32 Module.load
internal/modules/cjs/loader.js:877:14 Function.Module._load
internal/modules/cjs/loader.js:1019:19 Module.require
If you check the transpiled code of index.js
:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.onPostBuild = void 0;
const tslib_1 = require("tslib");
const generateRedirects_1 = require("./functions/generateRedirects");
const path = require("path");
exports.onPostBuild = (opts) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const { constants, inputs } = opts;
const { nextDir = path.join(constants.PUBLISH_DIR, '../.next') } = inputs;
yield generateRedirects_1.generateRedirects(opts)(nextDir, constants.PUBLISH_DIR);
});
//# sourceMappingURL=index.js.map
You see that tslib
is required to transpile async
/await
. To make it work, I believe you would need to either:
tslib
as a production dependencytarget
TypeScript option in order to inline tslib
helpersA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.